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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline Created 4 years, 11 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../inspector-test.js"></script> 3 <script src="../inspector-test.js"></script>
4 <script src="../resources-test.js"></script> 4 <script src="../resources-test.js"></script>
5 <script src="resource-tree-test.js"></script> 5 <script src="resource-tree-test.js"></script>
6 <script> 6 <script>
7 function loadStylesheet() 7 function loadStylesheet()
8 { 8 {
9 var styleElement = document.createElement("link"); 9 var styleElement = document.createElement("link");
10 styleElement.rel = "stylesheet"; 10 styleElement.rel = "stylesheet";
(...skipping 11 matching lines...) Expand all
22 22
23 function requestAdded(request) 23 function requestAdded(request)
24 { 24 {
25 if (request.url.indexOf("styles-initial") === -1) 25 if (request.url.indexOf("styles-initial") === -1)
26 return; 26 return;
27 resource = InspectorTest.resourceMatchingURL("styles-initial"); 27 resource = InspectorTest.resourceMatchingURL("styles-initial");
28 if (!resource || !resource.request || contentWasRequested) { 28 if (!resource || !resource.request || contentWasRequested) {
29 InspectorTest.addResult("Cannot find resource"); 29 InspectorTest.addResult("Cannot find resource");
30 InspectorTest.completeTest(); 30 InspectorTest.completeTest();
31 } 31 }
32 resource.requestContent(contentLoaded); 32 resource.requestContent().then(contentLoaded);
33 contentWasRequested = true; 33 contentWasRequested = true;
34 } 34 }
35 35
36 function pageAgentGetResourceContentCalled() 36 function pageAgentGetResourceContentCalled()
37 { 37 {
38 if (!resource.request.finished) { 38 if (!resource.request.finished) {
39 InspectorTest.addResult("Request must be finished before calling get ResourceContent"); 39 InspectorTest.addResult("Request must be finished before calling get ResourceContent");
40 InspectorTest.completeTest(); 40 InspectorTest.completeTest();
41 } 41 }
42 } 42 }
43 43
44 function contentLoaded(content) 44 function contentLoaded(content)
45 { 45 {
46 InspectorTest.addResult("Resource url: " + resource.url); 46 InspectorTest.addResult("Resource url: " + resource.url);
47 InspectorTest.addResult("Resource content: " + content); 47 InspectorTest.addResult("Resource content: " + content);
48 InspectorTest.completeTest(); 48 InspectorTest.completeTest();
49 } 49 }
50 } 50 }
51 </script> 51 </script>
52 </head> 52 </head>
53 <body onload="runTest()"> 53 <body onload="runTest()">
54 <p>Tests resource content is correctly loaded if Resource.requestContent was cal led before network request was finished.</p> 54 <p>Tests resource content is correctly loaded if Resource.requestContent was cal led before network request was finished.</p>
55 <a href="https://bugs.webkit.org/show_bug.cgi?id=90153">Bug 90153</a> 55 <a href="https://bugs.webkit.org/show_bug.cgi?id=90153">Bug 90153</a>
56 </body> 56 </body>
57 </html> 57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698