File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
cpp-tests/Classes/UITest/CocoStudioGUITest/UIWebViewTest Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ bool WebViewTest::init()
144144 evalJsBtn->setPosition (VisibleRect::center () - Vec2 ( _webView->getContentSize ().width /2 +
145145 evalJsBtn->getContentSize ().width /2 + 10 ,-50 ));
146146 evalJsBtn->addClickEventListener ([=](Ref*){
147- _webView->evaluateJS (" alert(\" hello\" )" );
147+ _webView->evaluateJS (" setTimeout(function(){ alert(\" hello\" );}, 0 )" );
148148 });
149149 evalJsBtn->setName (" evalJs" );
150150 this ->addChild (evalJsBtn);
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ function WebViewTest:init()
103103 evalJsBtn :setTitleText (" Evaluate JS" )
104104 evalJsBtn :setPosition (winSize .width / 2 - self ._webView :getContentSize ().width / 2 - evalJsBtn :getContentSize ().width / 2 - 30 , winSize .height / 2 - 50 )
105105 evalJsBtn :addClickEventListener (function (sender )
106- self ._webView :evaluateJS (" alert(\" hello\" )" )
106+ self ._webView :evaluateJS (" setTimeout(function(){ alert(\" hello\" );}, 0); " )
107107 end )
108108 self :addChild (evalJsBtn )
109109end
Original file line number Diff line number Diff line change @@ -200,11 +200,13 @@ function CreateTestMenu()
200200 CloseMenu :addChild (CloseItem )
201201 menuLayer :addChild (CloseMenu )
202202
203+ local targetPlatform = cc .Application :getInstance ():getTargetPlatform ()
204+
203205 -- add menu items for tests
204206 local MainMenu = cc .Menu :create ()
205207 local index = 0
206208 local obj = nil
207- for index , obj in pairs (_allTests ) do
209+ for index , obj in pairs (_allTests ) do
208210 local testLabel = cc .Label :createWithTTF (index .. " . " .. obj .name , s_arialPath , 24 )
209211 testLabel :setAnchorPoint (cc .p (0.5 , 0.5 ))
210212 local testMenuItem = cc .MenuItemLabel :create (testLabel )
You can’t perform that action at this time.
0 commit comments