Diff
Modified: trunk/LayoutTests/ChangeLog (270013 => 270014)
--- trunk/LayoutTests/ChangeLog 2020-11-19 04:00:18 UTC (rev 270013)
+++ trunk/LayoutTests/ChangeLog 2020-11-19 04:02:54 UTC (rev 270014)
@@ -1,5 +1,17 @@
2020-11-18 Chris Dumez <cdu...@apple.com>
+ Import web-platform-tests/geolocation-API tests from usptream
+ https://bugs.webkit.org/show_bug.cgi?id=219128
+
+ Reviewed by Sam Weinig.
+
+ Skip tests that are timing out.
+
+ * TestExpectations:
+ * tests-options.json:
+
+2020-11-18 Chris Dumez <cdu...@apple.com>
+
REGRESSION (r269598): [ Mac ] imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-network-error.sub.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=219008
<rdar://problem/71463894>
Modified: trunk/LayoutTests/TestExpectations (270013 => 270014)
--- trunk/LayoutTests/TestExpectations 2020-11-19 04:00:18 UTC (rev 270013)
+++ trunk/LayoutTests/TestExpectations 2020-11-19 04:02:54 UTC (rev 270014)
@@ -403,6 +403,9 @@
imported/w3c/web-platform-tests/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-cross-origin-tentative.https.sub.html [ Skip ]
imported/w3c/web-platform-tests/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy.tentative.https.sub.html [ Skip ]
imported/w3c/web-platform-tests/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html [ Skip ]
+imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https.html [ Skip ]
+imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https.html [ Skip ]
+imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https.html [ Skip ]
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-origin-idna.sub.window.html [ Skip ]
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_assign.html [ Skip ]
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/per-global.window.html [ Skip ]
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (270013 => 270014)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-11-19 04:00:18 UTC (rev 270013)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-11-19 04:02:54 UTC (rev 270014)
@@ -1,5 +1,44 @@
2020-11-18 Chris Dumez <cdu...@apple.com>
+ Import web-platform-tests/geolocation-API tests from usptream
+ https://bugs.webkit.org/show_bug.cgi?id=219128
+
+ Reviewed by Sam Weinig.
+
+ Import web-platform-tests/geolocation-API tests from usptream dd35c2b21b76772123f76.
+
+ * resources/import-expectations.json:
+ * web-platform-tests/geolocation-API/META.yml: Added.
+ * web-platform-tests/geolocation-API/PositionOptions.https-expected.txt: Added.
+ * web-platform-tests/geolocation-API/PositionOptions.https.html: Added.
+ * web-platform-tests/geolocation-API/clearWatch_TypeError-expected.txt: Added.
+ * web-platform-tests/geolocation-API/clearWatch_TypeError.html: Added.
+ * web-platform-tests/geolocation-API/getCurrentPosition_IDL.https-expected.txt: Added.
+ * web-platform-tests/geolocation-API/getCurrentPosition_IDL.https.html: Added.
+ * web-platform-tests/geolocation-API/getCurrentPosition_TypeError-expected.txt: Added.
+ * web-platform-tests/geolocation-API/getCurrentPosition_TypeError.html: Added.
+ * web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https-expected.txt: Added.
+ * web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https.html: Added.
+ * web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https-expected.txt: Added.
+ * web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https.html: Added.
+ * web-platform-tests/geolocation-API/idlharness.https.window-expected.txt: Added.
+ * web-platform-tests/geolocation-API/idlharness.https.window.html: Added.
+ * web-platform-tests/geolocation-API/idlharness.https.window.js: Added.
+ * web-platform-tests/geolocation-API/non-secure-contexts.http-expected.txt: Added.
+ * web-platform-tests/geolocation-API/non-secure-contexts.http.html: Added.
+ * web-platform-tests/geolocation-API/support.js: Added.
+ (setup):
+ (dummyFunction):
+ (positionToString):
+ (errorToString):
+ * web-platform-tests/geolocation-API/w3c-import.log: Added.
+ * web-platform-tests/geolocation-API/watchPosition_TypeError-expected.txt: Added.
+ * web-platform-tests/geolocation-API/watchPosition_TypeError.html: Added.
+ * web-platform-tests/geolocation-API/watchPosition_permission_deny.https-expected.txt: Added.
+ * web-platform-tests/geolocation-API/watchPosition_permission_deny.https.html: Added.
+
+2020-11-18 Chris Dumez <cdu...@apple.com>
+
Resync web-platform-tests/FileAPI tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=219125
Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (270013 => 270014)
--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2020-11-19 04:00:18 UTC (rev 270013)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2020-11-19 04:02:54 UTC (rev 270014)
@@ -210,7 +210,7 @@
"web-platform-tests/fullscreen": "skip",
"web-platform-tests/gamepad": "skip",
"web-platform-tests/generic-sensor": "skip",
- "web-platform-tests/geolocation-API": "skip",
+ "web-platform-tests/geolocation-API": "import",
"web-platform-tests/gyroscope": "skip",
"web-platform-tests/hr-time": "import",
"web-platform-tests/html": "import",
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/META.yml (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/META.yml (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/META.yml 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,5 @@
+spec: https://w3c.github.io/geolocation-api/
+suggested_reviewers:
+ - jdm
+ - yellowdoge
+ - zqzhang
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/PositionOptions.https-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/PositionOptions.https-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/PositionOptions.https-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,5 @@
+
+FAIL Call getCurrentPosition with wrong type for enableHighAccuracy. No exception expected. assert_unreached: An exception was thrown unexpectedly: Argument 2 ('errorCallback') to Geolocation.getCurrentPosition must be a function Reached unreachable code
+FAIL Call watchPosition with wrong type for enableHighAccuracy. No exception expected. assert_unreached: An exception was thrown unexpectedly: Argument 2 ('errorCallback') to Geolocation.watchPosition must be a function Reached unreachable code
+FAIL PositionOptions tests promise_test: Unhandled rejection with value: object "Error: unimplemented"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/PositionOptions.https.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/PositionOptions.https.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/PositionOptions.https.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,101 @@
+<!DOCTYPE HTML>
+<meta charset="utf-8">
+<title>Geolocation Test: PositionOptions tests</title>
+<link rel="help" href=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=''></script>
+
+<script>
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00123
+test(function() {
+ try {
+ geo.getCurrentPosition(dummyFunction, null, {enableHighAccuracy: "boom"});
+ geo.getCurrentPosition(dummyFunction, null, {enableHighAccuracy: 321});
+ geo.getCurrentPosition(dummyFunction, null, {enableHighAccuracy: -Infinity});
+ geo.getCurrentPosition(dummyFunction, null, {enableHighAccuracy: {foo: 5}});
+ } catch(e) {
+ assert_unreached('An exception was thrown unexpectedly: ' + e.message);
+ }
+}, 'Call getCurrentPosition with wrong type for enableHighAccuracy. No exception expected.');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00124
+test(function() {
+ try {
+ geo.watchPosition(dummyFunction, null, {enableHighAccuracy: "boom"});
+ geo.watchPosition(dummyFunction, null, {enableHighAccuracy: 321});
+ geo.watchPosition(dummyFunction, null, {enableHighAccuracy: -Infinity});
+ geo.watchPosition(dummyFunction, null, {enableHighAccuracy: {foo: 5}});
+ } catch(e) {
+ assert_unreached('An exception was thrown unexpectedly: ' + e.message);
+ }
+}, 'Call watchPosition with wrong type for enableHighAccuracy. No exception expected.');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00086, 00088, 00091 and 00092
+promise_test(async function() {
+ await test_driver.set_permission({name: 'geolocation'}, 'granted');
+
+ var t86 = async_test('Set timeout and maximumAge to 0, check that timeout error raised (getCurrentPosition)'),
+ t88 = async_test('Set timeout and maximumAge to 0, check that timeout error raised (watchPosition)'),
+ t91 = async_test('Check that a negative timeout value is equivalent to a 0 timeout value (getCurrentLocation)'),
+ t92 = async_test('Check that a negative timeout value is equivalent to a 0 timeout value (watchPosition)');
+
+ try {
+ geo.getCurrentPosition(
+ t86.unreached_func('A success callback was invoked unexpectedly'),
+ t86.step_func_done(function(err) {
+ assert_equals(err.code, err.TIMEOUT);
+ }),
+ {timeout: 0, maximumAge: 0}
+ );
+ } catch(e) {
+ t86.step(function() {
+ assert_unreached('An exception was thrown unexpectedly: ' + e.message);
+ });
+ }
+
+ try {
+ geo.watchPosition(
+ t88.unreached_func('A success callback was invoked unexpectedly'),
+ t88.step_func_done(function(err) {
+ assert_equals(err.code, err.TIMEOUT);
+ }),
+ {timeout: 0, maximumAge: 0}
+ );
+ } catch(e) {
+ t88.step(function() {
+ assert_unreached('An exception was thrown unexpectedly: ' + e.message);
+ });
+ }
+
+ try {
+ geo.getCurrentPosition(
+ t91.unreached_func('A success callback was invoked unexpectedly'),
+ t91.step_func_done(function(err) {
+ assert_equals(err.code, err.TIMEOUT);
+ }),
+ {timeout:-1, maximumAge: 0}
+ );
+ } catch(e) {
+ t91.step(function() {
+ assert_unreached('An exception was thrown unexpectedly: ' + e.message);
+ });
+ }
+
+ try {
+ geo.watchPosition(
+ t92.unreached_func('A success callback was invoked unexpectedly'),
+ t92.step_func_done(function(err) {
+ assert_equals(err.code, err.TIMEOUT);
+ }),
+ {timeout: -1, maximumAge: 0}
+ );
+ } catch(e) {
+ t92.step(function() {
+ assert_unreached('An exception was thrown unexpectedly: ' + e.message);
+ });
+ }
+}, 'PositionOptions tests');
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/clearWatch_TypeError-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/clearWatch_TypeError-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/clearWatch_TypeError-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,3 @@
+
+PASS Test that calling clearWatch with invalid watch IDs does not cause an exception
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/clearWatch_TypeError.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/clearWatch_TypeError.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/clearWatch_TypeError.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<meta charset='utf-8'>
+<title>Geolocation Test: clearWatch TypeError tests</title>
+<link rel='help' href=''>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+
+<div id='log'></div>
+
+<script>
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00080
+test(function() {
+ try {
+ geo.clearWatch(-1);
+ geo.clearWatch(0);
+ geo.clearWatch(1);
+ } catch(e) {
+ assert_unreached('An exception was thrown unexpectedly: ' + e.message);
+ }
+}, 'Test that calling clearWatch with invalid watch IDs does not cause an exception');
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_IDL.https-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_IDL.https-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_IDL.https-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,12 @@
+Clear all Geolocation permissions before running this test. If prompted for permission, please allow.
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT getCurrentPosition success callback tests Test timed out
+PASS getCurrentPosition error callback tests
+PASS GeolocationPositionError toString
+PASS PERMISSION_DENIED value is 1
+PASS POSITION_UNAVAILABLE is 2
+PASS TIMEOUT value is 3
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_IDL.https.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_IDL.https.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_IDL.https.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,151 @@
+<!DOCTYPE HTML>
+<meta charset="utf-8">
+<meta name=timeout content=long>
+<title>Geolocation Test: getCurrentPosition tests</title>
+<link rel="help" href=""
+<script src=""
+<script src=""
+
+<p>Clear all Geolocation permissions before running this test. If prompted for permission, please allow.</p>
+<div id="log"></div>
+<script>
+var geo, success, fail;
+
+setup(function() {
+ geo = navigator.geolocation;
+}, {explicit_done: true});
+
+function successCallback(position)
+{
+ var ii, oldval;
+
+ /*
+ interface GeolocationPosition {
+ readonly attribute GeolocationCoordinates coords;
+ readonly attribute DOMTimeStamp timestamp;
+ };
+ */
+
+ test(function() {
+ assert_equals(position.toString(), "[object GeolocationPosition]",
+ "position.toString should result in '[object GeolocationPosition]' was: " + position.toString());
+ }, "GeolocationPosition toString");
+
+ test(function() {
+ assert_equals(position.coords.toString(), "[object GeolocationCoordinates]",
+ "position.coords.toString should result in '[object GeolocationCoordinates]' was: " + position.coords.toString());
+ }, "GeolocationCoordinates toString");
+
+ test(function() {
+ assert_equals(typeof(position.timestamp), "number",
+ "position.timestamp should be of type 'number' was: " + typeof(position.timestamp));
+ }, "GeolocationPosition.timestamp is type number");
+
+ /*
+ interface GeolocationCoordinates {
+ readonly attribute double latitude;
+ readonly attribute double longitude;
+ readonly attribute double? altitude;
+ readonly attribute double accuracy;
+ readonly attribute double? altitudeAccuracy;
+ readonly attribute double? heading;
+ readonly attribute double? speed;
+ };
+ */
+
+ for (ii in position.coords) {
+ // these four can be numbers or null
+ if (ii == "altitude" || ii == "altitudeAccuracy" || ii == "heading" || ii == "speed") {
+ test(function() {
+ assert_true(position.coords[ii] === null || typeof(position.coords[ii]) === "number",
+ ii + " must be null or 'number' type, was: " + typeof(position.coords[ii]));
+ }, ii+ " is null or number");
+ } else {
+ test(function() {
+ assert_equals(typeof(position.coords[ii]), "number",
+ ii + " should be type 'number' but typeof returned: " + typeof(position.coords[ii]));
+ }, ii + " is type number");
+ }
+
+ oldval = position.coords[ii];
+ position.coords[ii] = 666;
+
+ test(function() {
+ assert_equals(position.coords[ii], oldval,
+ ii + " should be readonly, wrote: " + position.coords[ii] + " old value was " + oldval);
+ }, ii + " readonly");
+
+ }
+
+ success.done();
+ done();
+}
+
+function BadErrorCallback(error)
+{
+ success.step(function() {
+ assert_unreached("Error callback called in error");
+ });
+ success.done();
+ done();
+}
+
+function BadSuccessCallback(position)
+{
+ fail.step(function() {
+ assert_unreached("Success callback called in error");
+ });
+ fail.done();
+}
+
+function errorCallback(error)
+{
+ test(function() {
+ assert_equals(error.toString(), "[object GeolocationPositionError]",
+ "error.toString should result in '[object GeolocationPositionError]' was: " +
+ error.toString());
+ }, "GeolocationPositionError toString");
+
+ test(function() {
+ assert_equals(error.PERMISSION_DENIED, 1,
+ "PERMISSION_DENIED should be 1 was: " + error.POSITION_DENIED);
+ }, "PERMISSION_DENIED value is 1");
+
+ test(function() {
+ assert_equals(error.POSITION_UNAVAILABLE, 2,
+ "POSITION_UNAVAILABLE should be 2' was: " + error.POSITION_UNAVAILABLE);
+ }, "POSITION_UNAVAILABLE is 2");
+
+ test(function() {
+ assert_equals(error.TIMEOUT, 3,
+ "TIMEOUT should be 3 was: " + error.TIMEOUT);
+ }, "TIMEOUT value is 3");
+
+ fail.done();
+}
+
+success = async_test("getCurrentPosition success callback tests");
+
+// with a longer timeout and with the user accepting the position request,
+// this should test the successcallback
+success.step(function() {
+ geo.getCurrentPosition(
+ successCallback,
+ BadErrorCallback,
+ {maximumAge:600000, timeout:10000}
+ );
+});
+
+fail = async_test("getCurrentPosition error callback tests");
+
+// with a timeout of 0 the error callback is hopefully consistently called
+fail.step(function() {
+ geo.getCurrentPosition(
+ BadSuccessCallback,
+ errorCallback,
+ {maximumAge:00, timeout:0}
+ );
+});
+
+</script>
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_TypeError-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_TypeError-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_TypeError-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,8 @@
+
+PASS Call getCurrentPosition without arguments, check that exception is thrown
+PASS Call getCurrentPosition with null success callback, check that exception is thrown
+PASS Call getCurrentPosition with null success and error callbacks, check that exception is thrown
+PASS Call getCurrentPosition() with wrong type for first argument. Exception expected.
+PASS Call getCurrentPosition() with wrong type for second argument. Exception expected.
+PASS Call getCurrentPosition() with wrong type for third argument. Exception expected.
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_TypeError.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_TypeError.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_TypeError.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML>
+<meta charset='utf-8'>
+<title>Geolocation Test: getCurrentPosition TypeError tests</title>
+<link rel='help' href=''>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+
+<div id='log'></div>
+
+<script>
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00027
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.getCurrentPosition();
+ });
+}, 'Call getCurrentPosition without arguments, check that exception is thrown');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00011
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.getCurrentPosition(null);
+ });
+}, 'Call getCurrentPosition with null success callback, check that exception is thrown');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00013
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.getCurrentPosition(null, null);
+ });
+}, 'Call getCurrentPosition with null success and error callbacks, check that exception is thrown');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00028
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.getCurrentPosition(3);
+ });
+}, 'Call getCurrentPosition() with wrong type for first argument. Exception expected.');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00029
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.getCurrentPosition(dummyFunction, 4);
+ });
+}, 'Call getCurrentPosition() with wrong type for second argument. Exception expected.');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00030
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.getCurrentPosition(dummyFunction, dummyFunction, 4);
+ });
+}, 'Call getCurrentPosition() with wrong type for third argument. Exception expected.');
+
+done();
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,7 @@
+Clear all Geolocation permissions before running this test. If prompted for permission, please allow.
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT User allows access, check that success callback is called or error callback is called with correct code. Test timed out
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<meta charset='utf-8'>
+<title>Geolocation Test: getCurrentPosition location access allowed</title>
+<link rel='help' href=''>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+
+<p>Clear all Geolocation permissions before running this test. If prompted for permission, please allow.</p>
+<div id='log'></div>
+
+<script>
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00002
+var t = async_test('User allows access, check that success callback is called or error callback is called with correct code.'),
+ onSuccess, onError, hasMethodReturned = false;
+
+t.step(function() {
+ _onSuccess_ = t.step_func_done(function(pos) {
+ // Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00031
+ assert_true(hasMethodReturned);
+ });
+
+ _onError_ = t.step_func_done(function(err) {
+ // Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00031
+ assert_true(hasMethodReturned);
+ assert_false(isUsingPreemptivePermission);
+ assert_equals(err.code, err.POSITION_UNAVAILABLE, errorToString(err));
+ });
+
+ geo.getCurrentPosition(onSuccess, onError);
+ hasMethodReturned = true;
+});
+
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,7 @@
+Clear all Geolocation permissions before running this test. If prompted for permission, please deny.
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT User denies access, check that error callback is called with correct code Test timed out
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<meta charset='utf-8'>
+<title>Geolocation Test: getCurrentPosition location access denied</title>
+<link rel='help' href=''>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+
+<p>Clear all Geolocation permissions before running this test. If prompted for permission, please deny.</p>
+<div id='log'></div>
+
+<script>
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00001
+var t = async_test('User denies access, check that error callback is called with correct code'),
+ onSuccess, onError, hasMethodReturned = false;
+
+t.step(function() {
+ _onSuccess_ = t.step_func_done(function(pos) {
+ assert_unreached('A success callback was invoked unexpectedly with position ' + positionToString(pos));
+ });
+
+ _onError_ = t.step_func_done(function(err) {
+ // http://dev.w3.org/geo/api/test-suite/t.html?00031
+ assert_true(hasMethodReturned, 'Check that getCurrentPosition returns synchronously before any callbacks are invoked');
+ assert_equals(err.code, err.PERMISSION_DENIED, errorToString(err));
+ });
+
+ geo.getCurrentPosition(onSuccess, onError);
+ hasMethodReturned = true;
+});
+
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,68 @@
+
+PASS idl_test setup
+PASS idl_test validation
+PASS Partial interface Navigator: original interface defined
+PASS Partial interface Navigator: member names are unique
+PASS Partial interface mixin NavigatorID: member names are unique
+PASS Navigator includes NavigatorID: member names are unique
+PASS Navigator includes NavigatorLanguage: member names are unique
+PASS Navigator includes NavigatorOnLine: member names are unique
+PASS Navigator includes NavigatorContentUtils: member names are unique
+PASS Navigator includes NavigatorCookies: member names are unique
+PASS Navigator includes NavigatorPlugins: member names are unique
+PASS Navigator includes NavigatorConcurrentHardware: member names are unique
+PASS Geolocation interface: existence and properties of interface object
+PASS Geolocation interface object length
+PASS Geolocation interface object name
+PASS Geolocation interface: existence and properties of interface prototype object
+PASS Geolocation interface: existence and properties of interface prototype object's "constructor" property
+PASS Geolocation interface: existence and properties of interface prototype object's @@unscopables property
+PASS Geolocation interface: operation getCurrentPosition(PositionCallback, optional PositionErrorCallback, optional PositionOptions)
+PASS Geolocation interface: operation watchPosition(PositionCallback, optional PositionErrorCallback, optional PositionOptions)
+PASS Geolocation interface: operation clearWatch(long)
+PASS Geolocation must be primary interface of navigator.geolocation
+PASS Stringification of navigator.geolocation
+PASS Geolocation interface: navigator.geolocation must inherit property "getCurrentPosition(PositionCallback, optional PositionErrorCallback, optional PositionOptions)" with the proper type
+PASS Geolocation interface: calling getCurrentPosition(PositionCallback, optional PositionErrorCallback, optional PositionOptions) on navigator.geolocation with too few arguments must throw TypeError
+PASS Geolocation interface: navigator.geolocation must inherit property "watchPosition(PositionCallback, optional PositionErrorCallback, optional PositionOptions)" with the proper type
+PASS Geolocation interface: calling watchPosition(PositionCallback, optional PositionErrorCallback, optional PositionOptions) on navigator.geolocation with too few arguments must throw TypeError
+PASS Geolocation interface: navigator.geolocation must inherit property "clearWatch(long)" with the proper type
+PASS Geolocation interface: calling clearWatch(long) on navigator.geolocation with too few arguments must throw TypeError
+PASS GeolocationPosition interface: existence and properties of interface object
+PASS GeolocationPosition interface object length
+PASS GeolocationPosition interface object name
+PASS GeolocationPosition interface: existence and properties of interface prototype object
+PASS GeolocationPosition interface: existence and properties of interface prototype object's "constructor" property
+PASS GeolocationPosition interface: existence and properties of interface prototype object's @@unscopables property
+PASS GeolocationPosition interface: attribute coords
+PASS GeolocationPosition interface: attribute timestamp
+PASS GeolocationCoordinates interface: existence and properties of interface object
+PASS GeolocationCoordinates interface object length
+PASS GeolocationCoordinates interface object name
+PASS GeolocationCoordinates interface: existence and properties of interface prototype object
+PASS GeolocationCoordinates interface: existence and properties of interface prototype object's "constructor" property
+PASS GeolocationCoordinates interface: existence and properties of interface prototype object's @@unscopables property
+PASS GeolocationCoordinates interface: attribute latitude
+PASS GeolocationCoordinates interface: attribute longitude
+PASS GeolocationCoordinates interface: attribute altitude
+PASS GeolocationCoordinates interface: attribute accuracy
+PASS GeolocationCoordinates interface: attribute altitudeAccuracy
+PASS GeolocationCoordinates interface: attribute heading
+PASS GeolocationCoordinates interface: attribute speed
+PASS GeolocationPositionError interface: existence and properties of interface object
+PASS GeolocationPositionError interface object length
+PASS GeolocationPositionError interface object name
+PASS GeolocationPositionError interface: existence and properties of interface prototype object
+PASS GeolocationPositionError interface: existence and properties of interface prototype object's "constructor" property
+PASS GeolocationPositionError interface: existence and properties of interface prototype object's @@unscopables property
+PASS GeolocationPositionError interface: constant PERMISSION_DENIED on interface object
+PASS GeolocationPositionError interface: constant PERMISSION_DENIED on interface prototype object
+PASS GeolocationPositionError interface: constant POSITION_UNAVAILABLE on interface object
+PASS GeolocationPositionError interface: constant POSITION_UNAVAILABLE on interface prototype object
+PASS GeolocationPositionError interface: constant TIMEOUT on interface object
+PASS GeolocationPositionError interface: constant TIMEOUT on interface prototype object
+PASS GeolocationPositionError interface: attribute code
+PASS GeolocationPositionError interface: attribute message
+PASS Navigator interface: attribute geolocation
+PASS Navigator interface: navigator must inherit property "geolocation" with the proper type
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window.js (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window.js 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,17 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+// https://www.w3.org/TR/geolocation-API/
+
+idl_test(
+ ['geolocation-API'],
+ ['html'],
+ idl_array => {
+ self.audio = document.createElement('audio');
+ self.video = document.createElement('video');
+ idl_array.add_objects({
+ Navigator: ['navigator'],
+ Geolocation: ['navigator.geolocation'],
+ });
+ }
+);
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-secure-contexts.http-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-secure-contexts.http-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-secure-contexts.http-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,14 @@
+CONSOLE MESSAGE: [blocked] Access to geolocation was blocked over insecure connection to http://localhost:8800.
+
+CONSOLE MESSAGE: [blocked] Access to geolocation was blocked over insecure connection to http://localhost:8800.
+
+CONSOLE MESSAGE: [blocked] Access to geolocation was blocked over insecure connection to http://localhost:8800.
+
+CONSOLE MESSAGE: [blocked] Access to geolocation was blocked over insecure connection to http://localhost:8800.
+
+
+PASS When in a non-secure context, getCurrentPosition()'s errorCallback is asynchronously called.
+PASS When in a non-secure context, watchPosition()'s errorCallback is asynchronously called.
+PASS When in a non-secure context, the getCurrentPosition() errorCallBack gets a GeolocationPositionError with the correct error code.
+PASS When in a non-secure context, the watchPosition() errorCallBack gets a GeolocationPositionError with the correct error code.
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-secure-contexts.http.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-secure-contexts.http.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-secure-contexts.http.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>Geolocation Test: non-secure contexts</title>
+<link rel="help" href="" />
+<script src=""
+<script src=""
+<script>
+ promise_test(() => {
+ return new Promise(resolve => {
+ let isAsync = true;
+ const successCallback = () => {
+ assert_unreached(
+ "successCallback must never be invoked in non-secure contexts."
+ );
+ };
+ const errorCallBack = () => {
+ isAsync = false;
+ resolve();
+ };
+ navigator.geolocation.getCurrentPosition(successCallback, errorCallBack);
+ assert_true(
+ isAsync,
+ "Expected the errorCallback to be called asynchronously."
+ );
+ });
+ }, "When in a non-secure context, getCurrentPosition()'s errorCallback is asynchronously called.");
+
+ promise_test(async () => {
+ return new Promise(resolve => {
+ let isAsync = true;
+ const successCallback = () => {
+ assert_unreached(
+ "successCallback must never be invoked in non-secure contexts."
+ );
+ };
+ const errorCallBack = () => {
+ isAsync = false;
+ resolve();
+ };
+ navigator.geolocation.watchPosition(successCallback, errorCallBack);
+ assert_true(isAsync, "errorCallback must be called asynchronously.");
+ });
+ }, "When in a non-secure context, watchPosition()'s errorCallback is asynchronously called.");
+
+ promise_test(async () => {
+ const positionErrorPromise = new Promise(errorCallBack => {
+ const successCallback = () => {
+ assert_unreached(
+ "successCallback must never be invoked in non-secure contexts."
+ );
+ };
+ navigator.geolocation.getCurrentPosition(successCallback, errorCallBack);
+ });
+ const positionError = await positionErrorPromise;
+ assert_equals(
+ positionError.code,
+ 1,
+ "Expected the value for PERMISSION_DENIED, which is 1."
+ );
+ }, "When in a non-secure context, the getCurrentPosition() errorCallBack gets a GeolocationPositionError with the correct error code.");
+
+ promise_test(async () => {
+ const positionErrorPromise = new Promise(errorCallBack => {
+ const successCallback = () => {
+ assert_unreached(
+ "successCallback must never be invoked in non-secure contexts."
+ );
+ };
+ const id = navigator.geolocation.watchPosition(
+ successCallback,
+ errorCallBack
+ );
+ assert_true(Number.isInteger(id), "Must return an identifier.");
+ });
+ const positionError = await positionErrorPromise;
+ assert_equals(
+ positionError.code,
+ 1,
+ "Expected the value for PERMISSION_DENIED, which is 1."
+ );
+ }, "When in a non-secure context, the watchPosition() errorCallBack gets a GeolocationPositionError with the correct error code.");
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/support.js (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/support.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/support.js 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,30 @@
+var geo;
+
+setup(function() {
+ geo = navigator.geolocation;
+});
+
+// The spec states that an implementation SHOULD acquire user permission before
+// beggining the position acquisition steps. If an implementation follows this
+// advice, set the following flag to aid debugging.
+var isUsingPreemptivePermission = false;
+
+
+var dummyFunction = function() {};
+
+var positionToString = function(pos) {
+ var c = pos.coords;
+ return '[lat: ' + c.latitude + ', lon: ' + c.longitude + ', acc: ' + c.accuracy + ']';
+};
+
+var errorToString = function(err) {
+ var codeString;
+ switch(err.code) {
+ case err.UNKNOWN_ERROR: codeString = 'UNKNOWN_ERROR'; break;
+ case err.PERMISSION_DENIED: codeString = 'PERMISSION_DENIED'; break;
+ case err.POSITION_UNAVAILABLE: codeString = 'POSITION_UNAVAILABLE'; break;
+ case err.TIMEOUT: codeString = 'TIMEOUT'; break;
+ default: codeString = 'undefined error code'; break;
+ }
+ return '[code: ' + codeString + ' (' + err.code + '), message: ' + (err.message ? err.message : '(empty)') + ']';
+};
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/w3c-import.log (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/w3c-import.log 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,28 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/META.yml
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/PositionOptions.https.html
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/clearWatch_TypeError.html
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_IDL.https.html
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_TypeError.html
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https.html
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https.html
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/idlharness.https.window.js
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-secure-contexts.http.html
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/support.js
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_TypeError.html
+/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https.html
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_TypeError-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_TypeError-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_TypeError-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,8 @@
+
+PASS Call watchPosition without arguments, check that exception is thrown
+PASS Call watchPosition with null success callback, check that exception is thrown
+PASS Call watchPosition with null success and error callbacks, check that exception is thrown
+PASS Call watchPosition() with wrong type for first argument. Exception expected.
+PASS Call watchPosition() with wrong type for second argument. Exception expected.
+PASS Call watchPosition() with wrong type for third argument. Exception expected.
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_TypeError.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_TypeError.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_TypeError.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML>
+<meta charset='utf-8'>
+<title>Geolocation Test: watchPosition TypeError tests</title>
+<link rel='help' href=''>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+
+<div id='log'></div>
+
+<script>
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00058
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.watchPosition();
+ });
+}, 'Call watchPosition without arguments, check that exception is thrown');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00015
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.watchPosition(null);
+ });
+}, 'Call watchPosition with null success callback, check that exception is thrown');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00017
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.watchPosition(null, null);
+ });
+}, 'Call watchPosition with null success and error callbacks, check that exception is thrown');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00059
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.watchPosition(3);
+ });
+}, 'Call watchPosition() with wrong type for first argument. Exception expected.');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00060
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.watchPosition(dummyFunction, 4);
+ });
+}, 'Call watchPosition() with wrong type for second argument. Exception expected.');
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00061
+test(function() {
+ assert_throws_js(TypeError, function() {
+ geo.watchPosition(dummyFunction, dummyFunction, 4);
+ });
+}, 'Call watchPosition() with wrong type for third argument. Exception expected.');
+
+done();
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https-expected.txt (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https-expected.txt 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,8 @@
+Clear all Geolocation permissions before running this test. If prompted for permission, please deny.
+
+
+Harness Error (TIMEOUT), message = null
+
+NOTRUN Check that watchPosition returns synchronously before any callbacks are invoked.
+PASS Check that watchPosition returns a long
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https.html (0 => 270014)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https.html 2020-11-19 04:02:54 UTC (rev 270014)
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<meta charset='utf-8'>
+<title>Geolocation Test: watchPosition location access denied</title>
+<link rel='help' href=''>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+
+<p>Clear all Geolocation permissions before running this test. If prompted for permission, please deny.</p>
+<div id='log'></div>
+
+<script>
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00062
+var t = async_test('Check that watchPosition returns synchronously before any callbacks are invoked.'),
+ id, checkMethodHasReturned, hasMethodReturned = false;
+
+checkMethodHasReturned = t.step_func_done(function() {
+ assert_true(hasMethodReturned);
+});
+
+try {
+ id = geo.watchPosition(checkMethodHasReturned, checkMethodHasReturned);
+ hasMethodReturned = true;
+} catch(e) {
+ t.unreached_func('An exception was thrown unexpectedly: ' + e.message);
+}
+
+// Rewrite http://dev.w3.org/geo/api/test-suite/t.html?00151
+test(function() {
+ assert_greater_than_equal(id, -2147483648);
+ assert_less_than_equal(id, 2147483647);
+}, 'Check that watchPosition returns a long');
+</script>
Modified: trunk/LayoutTests/tests-options.json (270013 => 270014)
--- trunk/LayoutTests/tests-options.json 2020-11-19 04:00:18 UTC (rev 270013)
+++ trunk/LayoutTests/tests-options.json 2020-11-19 04:02:54 UTC (rev 270014)
@@ -1433,6 +1433,9 @@
"imported/w3c/web-platform-tests/fetch/redirect-navigate/preserve-fragment.html": [
"slow"
],
+ "imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_IDL.https.html": [
+ "slow"
+ ],
"imported/w3c/web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html": [
"slow"
],