File tree 3 files changed +5
-3
lines changed
cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest
3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ bool WebViewTest::init()
144
144
evalJsBtn->setPosition (VisibleRect::center () - Vec2 ( _webView->getContentSize ().width /2 +
145
145
evalJsBtn->getContentSize ().width /2 + 10 ,-50 ));
146
146
evalJsBtn->addClickEventListener ([=](Ref*){
147
- _webView->evaluateJS (" alert(\" hello\" )" );
147
+ _webView->evaluateJS (" setTimeout(function(){ alert(\" hello\" );}, 0 )" );
148
148
});
149
149
evalJsBtn->setName (" evalJs" );
150
150
this ->addChild (evalJsBtn);
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ function WebViewTest:init()
103
103
evalJsBtn :setTitleText (" Evaluate JS" )
104
104
evalJsBtn :setPosition (winSize .width / 2 - self ._webView :getContentSize ().width / 2 - evalJsBtn :getContentSize ().width / 2 - 30 , winSize .height / 2 - 50 )
105
105
evalJsBtn :addClickEventListener (function (sender )
106
- self ._webView :evaluateJS (" alert(\" hello\" )" )
106
+ self ._webView :evaluateJS (" setTimeout(function(){ alert(\" hello\" );}, 0); " )
107
107
end )
108
108
self :addChild (evalJsBtn )
109
109
end
Original file line number Diff line number Diff line change @@ -200,11 +200,13 @@ function CreateTestMenu()
200
200
CloseMenu :addChild (CloseItem )
201
201
menuLayer :addChild (CloseMenu )
202
202
203
+ local targetPlatform = cc .Application :getInstance ():getTargetPlatform ()
204
+
203
205
-- add menu items for tests
204
206
local MainMenu = cc .Menu :create ()
205
207
local index = 0
206
208
local obj = nil
207
- for index , obj in pairs (_allTests ) do
209
+ for index , obj in pairs (_allTests ) do
208
210
local testLabel = cc .Label :createWithTTF (index .. " . " .. obj .name , s_arialPath , 24 )
209
211
testLabel :setAnchorPoint (cc .p (0.5 , 0.5 ))
210
212
local testMenuItem = cc .MenuItemLabel :create (testLabel )
You can’t perform that action at this time.
0 commit comments