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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource-details.html

Issue 2208963002: [DevTools] Removed InspectorTest.invokeFunctionInPageAsync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-promise-from-other-tests
Patch Set: 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="../../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/timeline-test.js"></script> 4 <script src="../../../http/tests/inspector/timeline-test.js"></script>
5 <script> 5 <script>
6 6
7 function performActions(callback) 7 function performActions()
8 { 8 {
9 var callback;
10 var promise = new Promise((fulfill) => callback = fulfill);
9 function onRequestFinished() 11 function onRequestFinished()
10 { 12 {
11 if (!--requestsPending) 13 if (!--requestsPending)
12 callback(); 14 callback();
13 } 15 }
14 16
15 var requestsPending = 2; 17 var requestsPending = 2;
16 var image = new Image(); 18 var image = new Image();
17 image.onload = onRequestFinished; 19 image.onload = onRequestFinished;
caseq 2016/08/05 17:56:42 ... or maybe let's introduce something like Inspec
kozy 2016/08/10 01:21:14 Acknowledged.
18 image.src = "../resources/anImage.png"; 20 image.src = "../resources/anImage.png";
19 21
20 var script = document.createElement("script"); 22 var script = document.createElement("script");
21 script.src = "timeline-network-resource.js"; 23 script.src = "timeline-network-resource.js";
22 document.body.appendChild(script); 24 document.body.appendChild(script);
23 window.timelineNetworkResourceEvaluated = onRequestFinished; 25 window.timelineNetworkResourceEvaluated = onRequestFinished;
26 return promise;
24 } 27 }
25 28
26 function test() 29 function test()
27 { 30 {
28 var model = WebInspector.panels.timeline._model; 31 var model = WebInspector.panels.timeline._model;
29 32
30 InspectorTest.invokeAsyncWithTimeline("performActions", finish); 33 InspectorTest.invokeAsyncWithTimeline("performActions", finish);
31 34
32 function finish() 35 function finish()
33 { 36 {
(...skipping 21 matching lines...) Expand all
55 58
56 </script> 59 </script>
57 </head> 60 </head>
58 61
59 <body onload="runTest()"> 62 <body onload="runTest()">
60 <p> 63 <p>
61 Tests the Timeline UI API for network requests. 64 Tests the Timeline UI API for network requests.
62 </p> 65 </p>
63 </body> 66 </body>
64 </html> 67 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698