Title: [155009] trunk/LayoutTests
Revision
155009
Author
[email protected]
Date
2013-09-03 16:56:36 -0700 (Tue, 03 Sep 2013)

Log Message

The test inspector/geolocation-success.html is unreliable
https://bugs.webkit.org/show_bug.cgi?id=120655

Reviewed by Alexey Proskuryakov.

* inspector/geolocation-success.html:
The test was expecting everything would be done in the page context
when InspectorTest.evaluateInPage invoke the callback.

This is not the case, geolocation APIs are asynchronous.
The callbacks printLocation() and printError() may or may not be executed.

To fix this, the execution of each step is changed to depends on the completion
of the geolocation callback.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (155008 => 155009)


--- trunk/LayoutTests/ChangeLog	2013-09-03 23:21:10 UTC (rev 155008)
+++ trunk/LayoutTests/ChangeLog	2013-09-03 23:56:36 UTC (rev 155009)
@@ -1,3 +1,20 @@
+2013-09-03  Benjamin Poulain  <[email protected]>
+
+        The test inspector/geolocation-success.html is unreliable
+        https://bugs.webkit.org/show_bug.cgi?id=120655
+
+        Reviewed by Alexey Proskuryakov.
+
+        * inspector/geolocation-success.html:
+        The test was expecting everything would be done in the page context
+        when InspectorTest.evaluateInPage invoke the callback.
+
+        This is not the case, geolocation APIs are asynchronous.
+        The callbacks printLocation() and printError() may or may not be executed.
+
+        To fix this, the execution of each step is changed to depends on the completion
+        of the geolocation callback.
+
 2013-09-03  Oliver Hunt  <[email protected]>
 
         Support structured clone of Map and Set

Modified: trunk/LayoutTests/inspector/geolocation-success.html (155008 => 155009)


--- trunk/LayoutTests/inspector/geolocation-success.html	2013-09-03 23:21:10 UTC (rev 155008)
+++ trunk/LayoutTests/inspector/geolocation-success.html	2013-09-03 23:56:36 UTC (rev 155009)
@@ -15,32 +15,35 @@
 } else
     debug('This test can not be run without the LayoutTestController');
 
-function getGeolocation()
+function getGeolocation(webInspectorCallbackString)
 {
     function printLocation(pos)
     {
         console.log('lat: ' + pos.coords.latitude + ', long: ' + pos.coords.longitude);
+        finishTest();
     }
     function printError(err)
     {
         console.log('Error: ' + err.code);
+        finishTest();
     }
+    function finishTest()
+    {
+        testRunner.evaluateInWebInspector(0, webInspectorCallbackString);
+    }
     navigator.geolocation.getCurrentPosition(printLocation, printError, [])
 }
 
 function test()
 {
-    function callbackComplete()
+    window.testStep2 = function()
     {
-        InspectorTest.completeTest();
-    }
-    function callback()
-    {
         PageAgent.clearGeolocationOverride();
-        InspectorTest.evaluateInPage("getGeolocation()", callbackComplete);
+        InspectorTest.evaluateInPage("getGeolocation('InspectorTest.completeTest()')");
     }
+
     PageAgent.setGeolocationOverride(43.476093, -80.540299, 150);
-    InspectorTest.evaluateInPage("getGeolocation()", callback);
+    InspectorTest.evaluateInPage("getGeolocation('window.testStep2()')");
 }
 
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to