Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: chrome/test/data/subresource_filter/frame_set.html

Issue 2604173002: Prevent racey favicon loads in subresource filter browsertests. (Closed)
Patch Set: Wording Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/subresource_filter/subresource_filter_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/subresource_filter/frame_set.html
diff --git a/chrome/test/data/subresource_filter/frame_set.html b/chrome/test/data/subresource_filter/frame_set.html
index 803b11fbd746f62c75d0d92ab435ea6d4c3585c9..11aacb87ec2727d0e3087fbba461b020956fd905 100644
--- a/chrome/test/data/subresource_filter/frame_set.html
+++ b/chrome/test/data/subresource_filter/frame_set.html
@@ -1,15 +1,23 @@
<html>
<head>
- <script type="text/javascript">
- function insertFrameWithScriptAndNotify() {
- var frame = document.createElement("iframe");
- frame.name = "dynamic";
- frame.src = "frame_with_included_script.html";
- frame.onload = () => window.domAutomationController.send(true)
- frame.onerror = () => window.domAutomationController.send(false)
- document.body.appendChild(frame);
- }
- </script>
+ <!--
+ The favicon resource load is at race with the page load event. Specify a
+ data URI as the source of the icon, so that the load is not evaluated by
+ the subresource filter. This prevent flakiness in tests that verify, at
+ page load completion time, that the correct number of evaluated loads
+ have been recorded into histograms.
+ -->
+ <link rel="icon" href="data:image/png;base64,">
+ <script type="text/javascript">
+ function insertFrameWithScriptAndNotify() {
+ var frame = document.createElement("iframe");
+ frame.name = "dynamic";
+ frame.src = "frame_with_included_script.html";
+ frame.onload = () => window.domAutomationController.send(true)
+ frame.onerror = () => window.domAutomationController.send(false)
+ document.body.appendChild(frame);
+ }
+ </script>
</head>
<body>
<iframe name="one" src="frame_with_included_script.html"></iframe>
« no previous file with comments | « chrome/browser/subresource_filter/subresource_filter_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698