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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/console-fetch-logging.html

Issue 2208963002: [DevTools] Removed InspectorTest.invokeFunctionInPageAsync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-promise-from-other-tests
Patch Set: a Created 4 years, 4 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="console-test.js"></script> 4 <script src="console-test.js"></script>
5 <script src="network-test.js"></script> 5 <script src="network-test.js"></script>
6 <script> 6 <script>
7 function requestHelper(method, url, callback) 7 function requestHelper(method, url, callback)
8 { 8 {
9 console.log("sending a " + method + " request to " + url); 9 console.log("sending a " + method + " request to " + url);
10 // Delay invoking callback to let didFinishLoading() a chance to fire and lo g 10 // Delay invoking callback to let didFinishLoading() a chance to fire and lo g
11 // console message. 11 // console message.
12 function delayCallback() 12 function delayCallback()
13 { 13 {
14 setTimeout(callback, 0); 14 setTimeout(callback, 0);
15 } 15 }
16 makeFetch(url, {method: method}, delayCallback); 16 makeFetch(url, {method: method}).then(delayCallback);
17 } 17 }
18 18
19 function makeRequests(callback) 19 function makeRequests()
20 { 20 {
21 var callback;
22 var promise = new Promise((fulfill) => callback = fulfill);
21 step1(); 23 step1();
24 return promise;
22 25
23 function step1() 26 function step1()
24 { 27 {
25 // Page that exists. 28 // Page that exists.
26 requestHelper("GET", "resources/xhr-exists.html", step2); 29 requestHelper("GET", "resources/xhr-exists.html", step2);
27 } 30 }
28 31
29 function step2() 32 function step2()
30 { 33 {
31 // Page that doesn't exist. 34 // Page that doesn't exist.
(...skipping 14 matching lines...) Expand all
46 } 49 }
47 50
48 function test() 51 function test()
49 { 52 {
50 step1(); 53 step1();
51 54
52 function step1() 55 function step1()
53 { 56 {
54 function callback() 57 function callback()
55 { 58 {
56 InspectorTest.invokePageFunctionAsync("makeRequests", step2); 59 InspectorTest.callFunctionInPageAsync("makeRequests").then(step2);
57 } 60 }
58 InspectorTest.NetworkAgent.setMonitoringXHREnabled(true, callback); 61 InspectorTest.NetworkAgent.setMonitoringXHREnabled(true, callback);
59 } 62 }
60 63
61 function step2() 64 function step2()
62 { 65 {
63 function callback() 66 function callback()
64 { 67 {
65 InspectorTest.invokePageFunctionAsync("makeRequests", step3); 68 InspectorTest.callFunctionInPageAsync("makeRequests").then(step3);
66 } 69 }
67 InspectorTest.NetworkAgent.setMonitoringXHREnabled(false, callback); 70 InspectorTest.NetworkAgent.setMonitoringXHREnabled(false, callback);
68 } 71 }
69 72
70 function step3() 73 function step3()
71 { 74 {
72 function finish() 75 function finish()
73 { 76 {
74 InspectorTest.dumpConsoleMessages(); 77 InspectorTest.dumpConsoleMessages();
75 InspectorTest.completeTest(); 78 InspectorTest.completeTest();
76 } 79 }
77 InspectorTest.deprecatedRunAfterPendingDispatches(finish); 80 InspectorTest.deprecatedRunAfterPendingDispatches(finish);
78 } 81 }
79 } 82 }
80 //# sourceURL=console-fetch-logging.html 83 //# sourceURL=console-fetch-logging.html
81 </script> 84 </script>
82 </head> 85 </head>
83 86
84 <body onload="runTest()"> 87 <body onload="runTest()">
85 <p> 88 <p>
86 Tests that fetch logging works when XMLHttpRequest Logging is Enabled and doesn' t show logs when it is Disabled. 89 Tests that fetch logging works when XMLHttpRequest Logging is Enabled and doesn' t show logs when it is Disabled.
87 </p> 90 </p>
88 91
89 </body> 92 </body>
90 </html> 93 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698