Skip to content

Commit

Permalink
Import wpt@c85aa3307c29c969c3d153e1207e59738fa7764f
Browse files Browse the repository at this point in the history
Using wpt-import in Chromium 6f43270.
With Chromium commits locally applied on WPT:
d2f2e4f "[Anonymous iframe] Improve test for popup"
1d0cf39 "[ResourceTiming]: Refactor initiatorType tests"
85d0a2a "Update split-cache.html test."
aa46421 "[GridNG] Proper relayout of grid and out of flow items"


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
mcasas@chromium.org:
  external/wpt/geolocation-API

NOAUTOREVERT=true
R=rubber-stamper@appspot.gserviceaccount.com

No-Export: true
Cq-Include-Trybots: luci.chromium.try:linux-wpt-identity-fyi-rel,linux-wpt-input-fyi-rel
Change-Id: I3ee58c60437ecfa66dd63dfde3d583e82bb5b6f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3061879
Auto-Submit: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#907031}
  • Loading branch information
Chromium WPT Sync authored and Chromium LUCI CQ committed Jul 30, 2021
1 parent ad929a6 commit c089380
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 0 deletions.
3 changes: 3 additions & 0 deletions third_party/blink/web_tests/TestExpectations
Expand Up @@ -2617,6 +2617,9 @@ crbug.com/958381 [ Mac ] external/wpt/css/CSS2/tables/table-anonymous-objects-20
crbug.com/626703 external/wpt/service-workers/service-worker/worker-interception.https.html [ Failure ]

# ====== New tests from wpt-importer added here ======
crbug.com/626703 [ Mac10.14 ] external/wpt/html/cross-origin-opener-policy/historical/coep-navigate-popup-unsafe-inherit.https.html [ Timeout ]
crbug.com/626703 [ Mac10.15 ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/invalid-image-paint-error.https.html [ Failure ]
crbug.com/626703 external/wpt/geolocation-API/non-fully-active.https.html [ Timeout ]
crbug.com/626703 [ Mac10.14 ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/invalid-image-paint-error.https.html [ Failure ]
crbug.com/626703 [ Mac11.0 ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/invalid-image-paint-error.https.html [ Failure ]
crbug.com/626703 [ Mac10.15 ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/valid-image-after-load.https.html [ Failure ]
Expand Down
Expand Up @@ -806,6 +806,7 @@ crbug.com/1050754 external/wpt/external/wpt/fetch/api/basic/stream-safe-creation
crbug.com/1050754 external/wpt/external/wpt/fetch/api/request/request-bad-port.any.html [ Timeout ]
crbug.com/1050754 external/wpt/external/wpt/fetch/api/request/request-bad-port.any.sharedworker.html [ Failure ]
crbug.com/1050754 external/wpt/external/wpt/fetch/api/request/request-bad-port.any.worker.html [ Timeout ]
crbug.com/1050754 external/wpt/external/wpt/geolocation-API/non-fully-active.https.html [ Timeout ]
crbug.com/1050754 external/wpt/external/wpt/html/webappapis/structured-clone/structured-clone.html [ Failure ]
crbug.com/1050754 external/wpt/external/wpt/inert/inert-retargeting-iframe.tentative.html [ Failure ]
crbug.com/1050754 external/wpt/external/wpt/infrastructure/assumptions/non-local-ports.sub.window.html [ Timeout ]
Expand Down
15 changes: 15 additions & 0 deletions third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
Expand Up @@ -264137,6 +264137,12 @@
"1a2996928163f16a8dd496ef98e71bf7b523db45",
[]
],
"resources": {
"iframe.html": [
"25cf3d92f3942738686a267c22d95d4a6464af7e",
[]
]
},
"support.js": [
"960b5721c376973d8721cdd4e602c43f08897679",
[]
Expand Down Expand Up @@ -388942,6 +388948,15 @@
}
]
],
"non-fully-active.https.html": [
"fe70f04154a036acda676269b463c67f3e15c56c",
[
null,
{
"testdriver": true
}
]
],
"non-secure-contexts.http.html": [
"d491086cf8aeb601f406f802bec30e2fbc5880eb",
[
Expand Down
@@ -0,0 +1,103 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>Geolocation Test: non-fully active document</title>
<link rel="help" href="https://github.com/w3c/geolocation-api/pull/97" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="support.js"></script>

<script>
promise_test(async function () {
await test_driver.set_permission({ name: "geolocation" }, "granted");

// Create the iframe, wait for it to load...
const iframe = document.createElement("iframe");
iframe.src = "resources/iframe.html";
iframe.allow = "geolocation";
document.body.appendChild(iframe);

// ...wait for the iframe to load...
await new Promise((resolve) =>
iframe.addEventListener("load", resolve, { once: true })
);

// Steal geolocation.
const geo = iframe.contentWindow.navigator.geolocation;

// No longer fully active.
iframe.remove();

// Try to watch a position while not fully active...
const watchError = await new Promise((resolve, reject) => {
const watchId = geo.watchPosition(
reject, // We don't want a position
resolve // We want an error!
);
// Always return 0.
assert_equals(
watchId,
0,
"watchId is 0 when document is not fully-active"
);
// And again, to make sure it's not changing
const watchId2 = geo.watchPosition(
() => {},
() => {}
);
assert_equals(
watchId2,
0,
"watchId remains 0 when document is not fully-active"
);
});

assert_equals(
watchError.code,
GeolocationPositionError.POSITION_UNAVAILABLE,
"watchPosition() returns an error on non-fully-active document"
);

// Now try to get current position while not fully active...
const positionError = await new Promise((resolve, reject) => {
geo.getCurrentPosition(
reject, // We don't want a position
resolve // We want an error!
);
});
assert_equals(
positionError.code,
GeolocationPositionError.POSITION_UNAVAILABLE,
"getCurrentPosition() calls the errorCallback with POSITION_UNAVAILABLE"
);

// Re-attach, and go back to fully active.
document.body.appendChild(iframe);
iframe.contentWindow.opener = window;
await new Promise((resolve) =>
window.addEventListener("load", resolve, { once: true })
);

// And we are back to fully active.
let watchId;
let position = await new Promise((resolve, reject) => {
watchId = iframe.contentWindow.navigator.geolocation.watchPosition(
resolve,
reject
);
});
assert_true(Number.isInteger(watchId), "Expected some number for watchId");
assert_true(position, "Expected a position");

// Finally, let's get the position from the reattached document.
position = await new Promise((resolve, reject) => {
iframe.contentWindow.navigator.geolocation.getCurrentPosition(
resolve,
reject
);
});
assert_true(Boolean(position), "Expected a position");
iframe.contentWindow.navigator.geolocation.clearWatch(watchId);
}, "non-fully active document behavior");
</script>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<meta charset="utf-8">
<h1>Just a support file</h1>

0 comments on commit c089380

Please sign in to comment.