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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/inspector/network/resource-priority.html
diff --git a/LayoutTests/http/tests/inspector/network/resource-priority.html b/LayoutTests/http/tests/inspector/network/resource-priority.html
new file mode 100644
index 0000000000000000000000000000000000000000..b772ac932dff6a2245e4ca5b3b235a3a6835df1b
--- /dev/null
+++ b/LayoutTests/http/tests/inspector/network/resource-priority.html
@@ -0,0 +1,92 @@
+<html>
+<head>
+<script src="../inspector-test.js"></script>
+<script>
+function sendSyncScriptRequest()
+{
+ var iframe = document.createElement("iframe");
+ document.body.appendChild(iframe);
+ iframe.contentDocument.write('<html><body><script src="http://localhost:8000/inspector/network/resources/empty-script.js?sync"></s' + 'cript>;</body></html>');
+}
+
+function sendAsyncScriptRequest()
+{
+ var iframe = document.createElement("iframe");
+ document.body.appendChild(iframe);
+ iframe.contentDocument.write('<html><body><script src="http://localhost:8000/inspector/network/resources/empty-script.js?async" async></s' + 'cript>;</body></html>');
+}
+
+function sendXHRSync()
+{
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", "resources/empty.html?xhr-sync", false);
+ xhr.send();
+}
+
+function sendXHRAsync()
+{
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", "resources/empty.html?xhr-async");
+ xhr.send();
+}
+
+function sendImageRequest()
+{
+ var img = document.createElement("img");
+ img.src = "resources/abe.png";
+ document.body.appendChild(img);
+}
+
+function sendStyleRequest()
+{
+ var link = document.createElement("link");
+ link.rel = "stylesheet";
+ link.href = "resources/style.css";
+ document.head.appendChild(link);
+}
+
+function createIFrame()
+{
+ var iframe = document.createElement("iframe");
+ iframe.src = "resources/empty.html?iframe";
+ document.head.appendChild(iframe);
+}
+
+function test()
+{
+ var actions = [
+ "sendSyncScriptRequest",
+ "sendAsyncScriptRequest",
+ "sendXHRSync",
+ "sendXHRAsync",
+ "sendImageRequest",
+ "sendStyleRequest",
+ "createIFrame"
+ ];
+ InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted, onRequestStarted);
+
+ var nextAction = 0;
+ performNextRequest();
+
+ function performNextRequest()
+ {
+ if (nextAction >= actions.length) {
+ InspectorTest.networkManager.removeEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted, onRequestStarted);
+ InspectorTest.completeTest();
+ return;
+ }
+ InspectorTest.evaluateInPage(actions[nextAction++] + "()");
+ }
+ function onRequestStarted(event)
+ {
+ var request = event.data;
+ InspectorTest.addResult("Request: " + request.name() + " priority: " + request.initialPriority());
+ performNextRequest();
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests resource priorities.</p>
+</body>
+</html>
« 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