Commit c0d3c10f authored by Karan Bhatia's avatar Karan Bhatia Committed by Commit Bot

DNR: Remove AllowAllRequests_SrcDoc browser test.

r744448 added logic to ensure allowAllRequests were always applied to
srcdoc frames. That said, the added test is flaky. It seems the fetch
can be aborted when the frame unloads causing flakiness. However,
waiting for onload event before the fetch causes the request to arrive
in the browser after the corresponding navigation commit, defeating the
purpose of the test. Since there doesn't seem to be a reliable way to
reproduce requests from a frame arriving before a navigation commit,
simply delete the test.

BUG=1056031

Change-Id: I23fc2fdfe5719a0f10bdce025cf3556840f0c3a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088346Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747580}
parent 42275334
......@@ -3878,38 +3878,6 @@ 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,
DISABLED_AllowAllRequests_SrcDoc) {
TestRule block_rule = CreateGenericRule();
block_rule.id = kMinValidID;
block_rule.priority = kMinValidPriority;
block_rule.action->type = "block";
block_rule.condition->url_filter = "*";
TestRule allow_srcdoc_rule = CreateGenericRule();
allow_srcdoc_rule.id = kMinValidID + 1;
allow_srcdoc_rule.priority = kMinValidPriority + 1;
allow_srcdoc_rule.condition->resource_types =
std::vector<std::string>({"main_frame"});
allow_srcdoc_rule.action->type = "allowAllRequests";
allow_srcdoc_rule.condition->url_filter = "srcdoc";
ASSERT_NO_FATAL_FAILURE(
LoadExtensionWithRules({block_rule, allow_srcdoc_rule}));
GURL page_url = embedded_test_server()->GetURL("/srcdoc.html");
ui_test_utils::NavigateToURL(browser(), page_url);
const std::set<GURL> requests_seen = GetAndResetRequestsToServer();
EXPECT_TRUE(base::Contains(requests_seen, page_url));
GURL xhr_url = embedded_test_server()->GetURL("/subresources/xhr_target.txt");
EXPECT_TRUE(base::Contains(requests_seen, xhr_url));
}
// Test fixture to verify that host permissions for the request url and the
// request initiator are properly checked when redirecting requests. Loads an
// example.com url with four sub-frames named frame_[1..4] from hosts
......
<html>
<body>
<script>
let frame = document.createElement('iframe');
frame.srcdoc = '';
document.body.appendChild(frame);
// The fetch below will fail eventually, but the request will reach the
// browser.
frame.contentWindow.fetch('subresources/xhr_target.txt')
.catch((error) => {});
</script>
</body>
</html>
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