Commit 69c4cf46 authored by Katie Dektar's avatar Katie Dektar Committed by Commit Bot

Revert "DNR: Speculatively fix flaky DeclarativeNetRequestBrowserTest.AllowAllRequests_SrcDoc."

This reverts commit 77288e6f.

Reason for revert: All/DeclarativeNetRequestBrowserTest.AllowAllRequests_SrcDoc/0 is
consistently failing, and this change touches that test and is in the
blamelist, so I expect reverting it will be the fix. First failing build:
https://ci.chromium.org/p/chromium/builders/ci/Win10%20Tests%20x64/44692

Original change's description:
> DNR: Speculatively fix flaky DeclarativeNetRequestBrowserTest.AllowAllRequests_SrcDoc.
> 
> Wait for the fetch to complete before checking whether xhr request was
> seen by the browser. This should hopefully fix the flakiness since page
> load won't necessarily wait for the fetch to complete.
> 
> BUG=1050536, 1056031
> 
> Change-Id: I9c043d69c4d619e00737303d2aaa3c15dc587ae2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076658
> Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
> Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#744926}

TBR=lazyboy@chromium.org,karandeepb@chromium.org

Change-Id: I032be2858ed91613891949a5540a8875b56d5d04
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1050536, 1056031
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078595Reviewed-by: default avatarKatie Dektar <katie@chromium.org>
Commit-Queue: Katie Dektar <katie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745054}
parent 5a193a54
......@@ -3880,8 +3880,9 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest, AllowAllRequests) {
// Ensure allowAllRequests rules work correctly for srcdoc frames. Regression
// test for crbug.com/1050536.
// TODO(crbug.com/1056031): Re-enabled this test.
IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
AllowAllRequests_SrcDoc) {
DISABLED_AllowAllRequests_SrcDoc) {
TestRule block_rule = CreateGenericRule();
block_rule.id = kMinValidID;
block_rule.priority = kMinValidPriority;
......@@ -3899,15 +3900,9 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
ASSERT_NO_FATAL_FAILURE(
LoadExtensionWithRules({block_rule, allow_srcdoc_rule}));
content::DOMMessageQueue message_queue(web_contents());
GURL page_url = embedded_test_server()->GetURL("/srcdoc.html");
ui_test_utils::NavigateToURL(browser(), page_url);
// Wait for the fetch to complete.
std::string message;
ASSERT_TRUE(message_queue.WaitForMessage(&message));
EXPECT_EQ("\"failure\"", message) << message;
const std::set<GURL> requests_seen = GetAndResetRequestsToServer();
EXPECT_TRUE(base::Contains(requests_seen, page_url));
......
......@@ -8,11 +8,8 @@
// The fetch below will fail eventually, but the request will reach the
// browser.
frame.contentWindow.fetch('subresources/xhr_target.txt').then(() => {
domAutomationController.send('success');
}, () => {
domAutomationController.send('failure');
});
frame.contentWindow.fetch('subresources/xhr_target.txt')
.catch((error) => {});
</script>
</body>
......
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