Commit 378036cd authored by danakj's avatar danakj Committed by Commit Bot

Fix navigation-blocking-xorigin-iframe.js to not be flaky.

The test wants to wait for the frames to all load, but with site
isolation we have an extra load start/stop on the frame being swapped
out, so it can't use a hard-coded number of loads.

Instead, we wait for the known number of network requests to be made,
and also wait for all the frames to finish loading by watching the
number which have started loading. That brings us to a steady state at
which we can grab a non-flaky snapshot.

R=caseq@chromium.org

Bug: 906879
Change-Id: Id6458313fc4c946f2327af26b8ea81478861ec5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222726
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773732}
parent 54f8ed9e
...@@ -100,7 +100,6 @@ crbug.com/1050826 external/wpt/mixed-content/gen/top.http-rp/opt-in/object-tag.h ...@@ -100,7 +100,6 @@ crbug.com/1050826 external/wpt/mixed-content/gen/top.http-rp/opt-in/object-tag.h
# TODO(lukasza, alexmos): Burn down this list. # TODO(lukasza, alexmos): Burn down this list.
crbug.com/895001 external/wpt/html/user-activation/message-event-activation-api-iframe-cross-origin.sub.tentative.html [ Timeout Pass ] crbug.com/895001 external/wpt/html/user-activation/message-event-activation-api-iframe-cross-origin.sub.tentative.html [ Timeout Pass ]
crbug.com/872952 http/tests/media/autoplay/webaudio-autoplay-iframe-with-gesture.html [ Timeout Pass ] crbug.com/872952 http/tests/media/autoplay/webaudio-autoplay-iframe-with-gesture.html [ Timeout Pass ]
crbug.com/906879 http/tests/inspector-protocol/network/navigation-blocking-xorigin-iframe.js [ Pass Failure ]
crbug.com/949003 http/tests/printing/cross-site-frame-scrolled.html [ Pass Failure ] crbug.com/949003 http/tests/printing/cross-site-frame-scrolled.html [ Pass Failure ]
crbug.com/949003 http/tests/printing/cross-site-frame.html [ Pass Failure ] crbug.com/949003 http/tests/printing/cross-site-frame.html [ Pass Failure ]
crbug.com/1007228 external/wpt/fullscreen/api/element-request-fullscreen-and-move-to-iframe-manual.html [ Pass Failure ] crbug.com/1007228 external/wpt/fullscreen/api/element-request-fullscreen-and-move-to-iframe-manual.html [ Pass Failure ]
......
...@@ -475,7 +475,6 @@ ...@@ -475,7 +475,6 @@
"http/tests/dom/EventListener-incumbent-global-1.html", "http/tests/dom/EventListener-incumbent-global-1.html",
"http/tests/dom/EventListener-incumbent-global-2.html", "http/tests/dom/EventListener-incumbent-global-2.html",
"http/tests/images/image-decode-in-frame.html", "http/tests/images/image-decode-in-frame.html",
"http/tests/inspector-protocol/network/navigation-blocking-xorigin-iframe.js",
"http/tests/media/autoplay/webaudio-autoplay-iframe-with-gesture.html", "http/tests/media/autoplay/webaudio-autoplay-iframe-with-gesture.html",
"http/tests/misc/iframe-script-modify-attr.html", "http/tests/misc/iframe-script-modify-attr.html",
"http/tests/printing/cross-site-frame-scrolled.html", "http/tests/printing/cross-site-frame-scrolled.html",
......
...@@ -17,7 +17,10 @@ ...@@ -17,7 +17,10 @@
await dp.Network.continueInterceptedRequest(response); await dp.Network.continueInterceptedRequest(response);
} }
let loadCount = 5; // Main frame load + initial oopif-a load + initial oopif-b load +
// oopif-a redirect + oopif-b redirect.
const expectedRequests = 5;
let loadCount = 0;
let loadCallback; let loadCallback;
const loadPromise = new Promise(fulfill => loadCallback = fulfill); const loadPromise = new Promise(fulfill => loadCallback = fulfill);
...@@ -30,8 +33,15 @@ ...@@ -30,8 +33,15 @@
dp.Network.enable(), dp.Network.enable(),
dp.Page.enable() dp.Page.enable()
]); ]);
dp.Page.onFrameStartedLoading(e => {
++loadCount;
});
dp.Page.onFrameStoppedLoading(e => { dp.Page.onFrameStoppedLoading(e => {
if (!--loadCount) // When loading is done, we should have done 5 network requests. But (with
// site isolation off) we may finish loading both iframes before the
// redirects start, and loadCount would go to zero. So we want to wait for
// loadCount to go to zero after we have done the redirects.
if (!--loadCount && interceptionLog.length == expectedRequests)
loadCallback(); loadCallback();
}); });
await dp.Runtime.runIfWaitingForDebugger(); await dp.Runtime.runIfWaitingForDebugger();
......
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