Commit 16f78349 authored by Philip Jägenstedt's avatar Philip Jägenstedt Committed by Commit Bot

Move target-in-different-window.html into wpt/

With tweaks from this comment:
https://github.com/web-platform-tests/wpt/pull/12858#issuecomment-419775438

Bug: 879798
Change-Id: I3806dffd01dcc7a1f7dd21a7fe68ce3c099df181
Reviewed-on: https://chromium-review.googlesource.com/1224010Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594690}
parent 8286ed37
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./resources/intersection-observer-test-utils.js"></script>
<script>
......@@ -9,7 +9,7 @@ var popup, target;
function waitForPopupNotification(f) {
popup.requestAnimationFrame(function() {
popup.setTimeout(function() { popup.setTimeout(f); });
popup.requestAnimationFrame(function() { popup.setTimeout(f); });
});
}
......@@ -18,19 +18,19 @@ async_test((t) => {
entries = entries.concat(changes);
});
popup = window.open();
t.add_cleanup(() => popup.close());
target = popup.document.createElement('div');
target.style.width = "100px";
target.style.height = "100px";
observer.observe(target);
waitForPopupNotification(() => {
waitForPopupNotification(t.step_func(() => {
assert_equals(entries.length, 1, "Initial notification for detached target.");
assert_equals(entries[0].isIntersecting, false, "not intersecting");
popup.document.body.appendChild(target);
waitForPopupNotification(() => {
waitForPopupNotification(t.step_func_done(() => {
assert_equals(entries.length, 2, "Notification after insertion into popup.");
assert_equals(entries[1].isIntersecting, true, "intersecting");
t.done();
});
});
}));
}));
}, "IntersectionObserver with target in a different window.");
</script>
......@@ -169,6 +169,7 @@ SET TIMEOUT: html/webappapis/scripting/events/event-handler-processing-algorithm
SET TIMEOUT: html/webappapis/scripting/processing-model-2/*
SET TIMEOUT: IndexedDB/*
SET TIMEOUT: infrastructure/*
SET TIMEOUT: intersection-observer/target-in-different-window.html
SET TIMEOUT: media-source/mediasource-util.js
SET TIMEOUT: media-source/URL-createObjectURL-revoke.html
SET TIMEOUT: mixed-content/generic/sanity-checker.js
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment