Cleaup subframes used in wpt/html/user-activation/*.html.
Change-Id: I4a7dae4534339ec2f203efa3860d5b8a9e5e9ba4
TBR: lanwei@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1677127
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672262}
diff --git a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-api-iframe.tenative.html b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-api-iframe.tenative.html
index 2202048..16b0ba6 100644
--- a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-api-iframe.tenative.html
+++ b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-api-iframe.tenative.html
@@ -14,7 +14,7 @@
<body>
<h1>Clicking in iframe has activation state in child</h1>
<ol id="instructions">
- <li>Click inside the red area.
+ <li>Click inside the light-grey area.
</ol>
<iframe id="child" width="200" height="200"></iframe>
<script>
diff --git a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-cross-origin-with-click-two-child-frames.sub.tentative.html b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-cross-origin-with-click-two-child-frames.sub.tentative.html
index edaad26..777cb5b 100644
--- a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-cross-origin-with-click-two-child-frames.sub.tentative.html
+++ b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-cross-origin-with-click-two-child-frames.sub.tentative.html
@@ -24,12 +24,12 @@
var child1 = document.getElementById("child1");
var child2 = document.getElementById("child2");
var is_child_four_loaded = false;
- var is_child_five_loaded = false;
+ var is_child_two_loaded = false;
assert_false(navigator.userActivation.isActive);
assert_false(navigator.userActivation.hasBeenActive);
function tryClickInstructions() {
- if (is_child_four_loaded && is_child_five_loaded)
+ if (is_child_four_loaded && is_child_two_loaded)
test_driver.click(document.getElementById('instructions'));
}
@@ -52,15 +52,15 @@
assert_false(navigator.userActivation.hasBeenActive);
child2.contentWindow.postMessage('report', '*');
- } else if (msg.type == 'child-five-loaded') {
+ } else if (msg.type == 'child-two-loaded') {
// state should be false after load
assert_false(msg.isActive);
assert_false(msg.hasBeenActive);
// click in parent document after both child frames load
- is_child_five_loaded = true;
+ is_child_two_loaded = true;
tryClickInstructions();
- } else if (msg.type == 'child-five-report') {
+ } else if (msg.type == 'child-two-report') {
assert_false(msg.isActive);
assert_false(msg.hasBeenActive);
@@ -75,7 +75,7 @@
assert_true(navigator.userActivation.hasBeenActive);
// transfer user activation to the child frame
- child1.contentWindow.postMessage("transfer_user_activation",
+ child1.contentWindow.postMessage("report",
{targetOrigin: "*", transferUserActivation: true});
// sender's activation state is updated synchronously
@@ -83,7 +83,7 @@
assert_false(navigator.userActivation.hasBeenActive);
}));
child1.src = "http://{{domains[www]}}:{{ports[http][0]}}/html/user-activation/resources/child-four.html";
- child2.src = "http://{{domains[www1]}}:{{ports[http][0]}}/html/user-activation/resources/child-five.html";
+ child2.src = "http://{{domains[www1]}}:{{ports[http][0]}}/html/user-activation/resources/child-two.html";
}, "Cross-origin user activation transfer through postMessages");
</script>
</body>
diff --git a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-cross-origin-with-click.sub.tentative.html b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-cross-origin-with-click.sub.tentative.html
index e7d98c3b1..ef1602a8 100644
--- a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-cross-origin-with-click.sub.tentative.html
+++ b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-cross-origin-with-click.sub.tentative.html
@@ -48,7 +48,7 @@
assert_true(navigator.userActivation.hasBeenActive);
// transfer user activation to the child frame
- child.contentWindow.postMessage("transfer_user_activation",
+ child.contentWindow.postMessage("report",
{targetOrigin: "*", transferUserActivation: true});
// sender's activation state is updated synchronously
diff --git a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-with-click.tentative.html b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-with-click.tentative.html
index 6b7a2b72..040d36c 100644
--- a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-with-click.tentative.html
+++ b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-with-click.tentative.html
@@ -48,7 +48,7 @@
assert_true(navigator.userActivation.hasBeenActive);
// transfer user activation to the child frame
- child.contentWindow.postMessage("transfer_user_activation",
+ child.contentWindow.postMessage("report",
{transferUserActivation: true});
// sender's activation state is updated synchronously
diff --git a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-without-click.tentative.html b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-without-click.tentative.html
index 50cce1f..a12d434 100644
--- a/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-without-click.tentative.html
+++ b/third_party/blink/web_tests/external/wpt/html/user-activation/activation-transfer-without-click.tentative.html
@@ -22,7 +22,7 @@
function tryPostMessaging() {
if (is_page_loaded && is_child_four_loaded)
- child.contentWindow.postMessage("transfer_user_activation", {transferUserActivation: true});
+ child.contentWindow.postMessage("report", {transferUserActivation: true});
}
window.addEventListener("message", t.step_func(event => {
diff --git a/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-five.html b/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-five.html
deleted file mode 100644
index 9260a300..0000000
--- a/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-five.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<body style="background: red;">
-<script>
- window.parent.postMessage(JSON.stringify({"type": "child-five-loaded", "isActive": navigator.userActivation.isActive,
- "hasBeenActive": navigator.userActivation.hasBeenActive}), "*");
-
- window.addEventListener("message", event => {
- if (event.source === window.parent && event.data == "report") {
- window.parent.postMessage(JSON.stringify({"type": "child-five-report", "isActive": navigator.userActivation.isActive,
- "hasBeenActive": navigator.userActivation.hasBeenActive}), "*");
- }
- });
-
-</script>
-</body>
diff --git a/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-four.html b/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-four.html
index 4811edb..65d17f27 100644
--- a/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-four.html
+++ b/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-four.html
@@ -5,7 +5,7 @@
"hasBeenActive": navigator.userActivation.hasBeenActive}), "*");
window.addEventListener("message", event => {
- if (event.source === window.parent && event.data == "transfer_user_activation") {
+ if (event.source === window.parent && event.data == "report") {
window.parent.postMessage(JSON.stringify({"type": "child-four-report", "isActive": navigator.userActivation.isActive,
"hasBeenActive": navigator.userActivation.hasBeenActive}), "*");
}
diff --git a/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-two.html b/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-two.html
index 7d48789..1fa8343 100644
--- a/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-two.html
+++ b/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-two.html
@@ -1,7 +1,15 @@
<!DOCTYPE html>
-<body style="background: red;">
+<body style="background: lightgrey;">
<script>
- window.parent.postMessage(JSON.stringify({"type": "child-two-loaded", "isActive": navigator.userActivation.isActive,
- "hasBeenActive": navigator.userActivation.hasBeenActive}), "*");
+ window.parent.postMessage(JSON.stringify({"type": "child-two-loaded", "isActive": navigator.userActivation.isActive,
+ "hasBeenActive": navigator.userActivation.hasBeenActive}), "*");
+
+ window.addEventListener("message", event => {
+ if (event.source === window.parent && event.data == "report") {
+ window.parent.postMessage(JSON.stringify({"type": "child-two-report", "isActive": navigator.userActivation.isActive,
+ "hasBeenActive": navigator.userActivation.hasBeenActive}), "*");
+ }
+ });
+
</script>
</body>