Commit d77e9337 authored by Alex Turner's avatar Alex Turner Committed by Commit Bot

Fix ChildrenOfFrameWithWindowStopAbortedLoad_StillCorrectlyTagged test

Reenables the previously flaky test AdTaggingBrowserTest.
ChildrenOfFrameWithWindowStopAbortedLoad_StillCorrectlyTagged, with the
following changes.

The scripts added by createFrameWithWindowStopAbortedLoad now have
async set to false to ensure that they are loaded in insertion order.
This allows the last script's onload handler to correctly signal that
all three scripts have loaded. This change was made for
create*Ad*FrameWithWindowStopAbortedLoad (crrev.com/c/2144832), but this
function also needs to be changed to avoid flakiness.

Bug: 1069346
Change-Id: I32733290cb41a03351b969b62e8118c5be1401e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2148544Reviewed-by: default avatarJohn Delaney <johnidel@chromium.org>
Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Commit-Queue: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758896}
parent facf49bd
......@@ -529,7 +529,7 @@ IN_PROC_BROWSER_TEST_F(
// This test is flaky. See crbug.com/1069346.
IN_PROC_BROWSER_TEST_F(
AdTaggingBrowserTest,
DISABLED_ChildrenOfFrameWithWindowStopAbortedLoad_StillCorrectlyTagged) {
ChildrenOfFrameWithWindowStopAbortedLoad_StillCorrectlyTagged) {
TestSubresourceFilterObserver observer(web_contents());
// Main frame.
......
......@@ -65,16 +65,21 @@ function createFrameWithWindowStopAbortedLoad(name) {
document.body.appendChild(frame);
frame.contentWindow.stop();
// We load the scripts in frame_factory.html to allow subframe creation.
// We load the scripts in frame_factory.html to allow subframe creation. We
// set the async attribute to false to ensure that these scripts are loaded in
// insertion order.
let script1 = document.createElement('script');
script1.async = false;
script1.src = 'create_frame.js';
frame.contentDocument.head.appendChild(script1);
let script2 = document.createElement('script');
script1.async = false;
script2.src = 'ad_script.js';
frame.contentDocument.head.appendChild(script2);
let script3 = document.createElement('script');
script1.async = false;
script3.src = 'ad_script_2.js';
// Set title so we know when all scripts have loaded.
script3.onload = function() {
......
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