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

Side by Side Diff: LayoutTests/http/tests/inspector/network/resource-priority.html

Issue 1324073003: DevTools: expose initial priority of a resource request in Network.requestWillBeSent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | LayoutTests/http/tests/inspector/network/resource-priority-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script>
5 function sendSyncScriptRequest()
6 {
7 var iframe = document.createElement("iframe");
8 document.body.appendChild(iframe);
9 iframe.contentDocument.write('<html><body><script src="http://localhost:8000 /inspector/network/resources/empty-script.js?sync"></s' + 'cript>;</body></html> ');
10 }
11
12 function sendAsyncScriptRequest()
13 {
14 var iframe = document.createElement("iframe");
15 document.body.appendChild(iframe);
16 iframe.contentDocument.write('<html><body><script src="http://localhost:8000 /inspector/network/resources/empty-script.js?async" async></s' + 'cript>;</body> </html>');
17 }
18
19 function sendXHRSync()
20 {
21 var xhr = new XMLHttpRequest();
22 xhr.open("GET", "resources/empty.html?xhr-sync", false);
23 xhr.send();
24 }
25
26 function sendXHRAsync()
27 {
28 var xhr = new XMLHttpRequest();
29 xhr.open("GET", "resources/empty.html?xhr-async");
30 xhr.send();
31 }
32
33 function sendImageRequest()
34 {
35 var img = document.createElement("img");
36 img.src = "resources/abe.png";
37 document.body.appendChild(img);
38 }
39
40 function sendStyleRequest()
41 {
42 var link = document.createElement("link");
43 link.rel = "stylesheet";
44 link.href = "resources/style.css";
45 document.head.appendChild(link);
46 }
47
48 function createIFrame()
49 {
50 var iframe = document.createElement("iframe");
51 iframe.src = "resources/empty.html?iframe";
52 document.head.appendChild(iframe);
53 }
54
55 function test()
56 {
57 var actions = [
58 "sendSyncScriptRequest",
59 "sendAsyncScriptRequest",
60 "sendXHRSync",
61 "sendXHRAsync",
62 "sendImageRequest",
63 "sendStyleRequest",
64 "createIFrame"
65 ];
66 InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Ev entTypes.RequestStarted, onRequestStarted);
67
68 var nextAction = 0;
69 performNextRequest();
70
71 function performNextRequest()
72 {
73 if (nextAction >= actions.length) {
74 InspectorTest.networkManager.removeEventListener(WebInspector.Networ kManager.EventTypes.RequestStarted, onRequestStarted);
75 InspectorTest.completeTest();
76 return;
77 }
78 InspectorTest.evaluateInPage(actions[nextAction++] + "()");
79 }
80 function onRequestStarted(event)
81 {
82 var request = event.data;
83 InspectorTest.addResult("Request: " + request.name() + " priority: " + r equest.initialPriority());
84 performNextRequest();
85 }
86 }
87 </script>
88 </head>
89 <body onload="runTest()">
90 <p>Tests resource priorities.</p>
91 </body>
92 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/network/resource-priority-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698