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

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

Issue 1259393002: DevTools: add support for logging fetch requests when XHR logging is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed the test Created 5 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/console-fetch-logging-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 src="console-test.js"></script>
5 <script src="network-test.js"></script>
6 <script>
7 function requestHelper(method, url, callback)
8 {
9 console.log("sending a " + method + " request to " + url);
10 // Delay invoking callback to let didFinishLoading() a chance to fire and lo g
11 // console message.
12 function delayCallback()
13 {
14 setTimeout(callback, 0);
15 }
16 makeFetch(url, {method: method}, delayCallback);
17 }
18
19 function makeRequests(callback)
20 {
21 step1();
22
23 function step1()
24 {
25 // Page that exists.
26 requestHelper("GET", "resources/xhr-exists.html", step2);
27 }
28
29 function step2()
30 {
31 // Page that doesn't exist.
32 requestHelper("GET", "resources/xhr-does-not-exist.html", step3);
33 }
34
35 function step3()
36 {
37 // POST to a page.
38 requestHelper("POST", "resources/post-target.cgi", step4);
39 }
40
41 function step4()
42 {
43 // (Failed) cross-origin request
44 requestHelper("GET", "http://localhost:8000/inspector/resources/xhr-exis ts.html", callback);
45 }
46 }
47
48 function test()
49 {
50 step1();
51
52 function step1()
53 {
54 function callback()
55 {
56 InspectorTest.invokePageFunctionAsync("makeRequests", step2);
57 }
58 InspectorTest.NetworkAgent.setMonitoringXHREnabled(true, callback);
59 }
60
61 function step2()
62 {
63 function callback()
64 {
65 InspectorTest.invokePageFunctionAsync("makeRequests", step3);
66 }
67 InspectorTest.NetworkAgent.setMonitoringXHREnabled(false, callback);
68 }
69
70 function step3()
71 {
72 function finish()
73 {
74 InspectorTest.dumpConsoleMessages();
75 InspectorTest.completeTest();
76 }
77 InspectorTest.runAfterPendingDispatches(finish);
78 }
79 }
80 //# sourceURL=console-fetch-logging.html
81 </script>
82 </head>
83
84 <body onload="runTest()">
85 <p>
86 Tests that fetch logging works when XMLHttpRequest Logging is Enabled and doesn' t show logs when it is Disabled.
87 </p>
88
89 </body>
90 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/console-fetch-logging-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698