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

Side by Side Diff: chrome/test/data/prerender/prefetch_page.html

Issue 2438593002: [NoStatePrefetch] Remove JS injection in tests (Closed)
Patch Set: PrefetchSimple: check the should-be-fetched resource is indeed fetched Created 4 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/prerender/prefetch.js ('k') | chrome/test/data/prerender/prefetch_page2.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <!-- 2 <!--
3 Prefetch page which fetches a script. It includes some javascript that can be 3 A page that fetches only "prefetch.js" when scanned by NoStatePrefetch, and
4 used to test whether execution occurred. 4 fetches "prefetch2.js" in addition to that if javascript execution is preformed
5 on the page. In all cases the scripts are executed in a blocking manner.
6
7 By prefetching this page a browsertest can verify that javascript was not
8 executed (prefetch2.js should not be requested to load even after the page has
9 been fully prefetched (or loaded)).
10
11 Note: there is no way to ensure that the script loaded via .appendChild() or a
12 sync XHR happens before a preload-scannable request because preload scanner is
13 racy and often fetches resources it sees before the inline script has a chance
14 to execute.
5 --> 15 -->
6 <head>
7 <title>Prefetch Page</title>
8 <script src="prefetch.js" type="text/javascript"></script>
9
10 <script>
11 // Variables to test if javascript is executed.
12 var pageBool = true;
13 var pageAntiBool = false;
14 </script>
15
16 </head>
17 <body> 16 <body>
18 Page content that is necessary for first contentful paint metrics 17 <script src="prefetch.js"></script>
18 <script>
19 var s = document.createElement("script");
20 s.src = "prefetch2.js";
21 document.body.appendChild(s);
22 </script>
23 Some content that is necessary for registering paint metrics.
19 </body> 24 </body>
20 </html> 25 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/prerender/prefetch.js ('k') | chrome/test/data/prerender/prefetch_page2.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698