Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ bool WebViewTest::init()
evalJsBtn->setPosition(VisibleRect::center() - Vec2( _webView->getContentSize().width/2 +
evalJsBtn->getContentSize().width/2 + 10,-50 ));
evalJsBtn->addClickEventListener([=](Ref*){
_webView->evaluateJS("alert(\"hello\")");
_webView->evaluateJS("setTimeout(function(){alert(\"hello\");}, 0)");
});
evalJsBtn->setName("evalJs");
this->addChild(evalJsBtn);
Expand Down
2 changes: 1 addition & 1 deletion tests/lua-tests/src/WebViewTest/WebViewTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function WebViewTest:init()
evalJsBtn:setTitleText("Evaluate JS")
evalJsBtn:setPosition(winSize.width / 2 - self._webView:getContentSize().width/2 - evalJsBtn:getContentSize().width/2 - 30, winSize.height / 2 - 50)
evalJsBtn:addClickEventListener(function(sender)
self._webView:evaluateJS("alert(\"hello\")")
self._webView:evaluateJS("setTimeout(function(){alert(\"hello\");}, 0);")
end)
self:addChild(evalJsBtn)
end
Expand Down
4 changes: 3 additions & 1 deletion tests/lua-tests/src/mainMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,13 @@ function CreateTestMenu()
CloseMenu:addChild(CloseItem)
menuLayer:addChild(CloseMenu)

local targetPlatform = cc.Application:getInstance():getTargetPlatform()

-- add menu items for tests
local MainMenu = cc.Menu:create()
local index = 0
local obj = nil
for index, obj in pairs(_allTests) do
for index, obj in pairs(_allTests) do
local testLabel = cc.Label:createWithTTF(index .. ". " .. obj.name, s_arialPath, 24)
testLabel:setAnchorPoint(cc.p(0.5, 0.5))
local testMenuItem = cc.MenuItemLabel:create(testLabel)
Expand Down