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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-load-event.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="../../../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 function display(callback) 6 function display()
7 { 7 {
8 var callback;
9 var promise = new Promise((fulfill) => callback = fulfill);
8 if (window.testRunner) 10 if (window.testRunner)
9 testRunner.setCanOpenWindows(true); 11 testRunner.setCanOpenWindows(true);
10 var popup = window.open("data:text/html,<b>Hello, world</b>"); 12 var popup = window.open("data:text/html,<b>Hello, world</b>");
11 popup.onload = function() 13 popup.onload = function()
12 { 14 {
13 requestAnimationFrame(testRunner.capturePixelsAsyncThen.bind(testRunner, callback)); 15 requestAnimationFrame(testRunner.capturePixelsAsyncThen.bind(testRunner, callback));
14 } 16 }
17 return promise;
15 } 18 }
16 19
17 function test() 20 function test()
18 { 21 {
19 WebInspector.panels.timeline._captureJSProfileSetting.set(false); 22 WebInspector.panels.timeline._captureJSProfileSetting.set(false);
20 InspectorTest.startTimeline(function() { InspectorTest.reloadPage(pageReload ed); }); 23 InspectorTest.startTimeline(function() { InspectorTest.reloadPage(pageReload ed); });
21 24
22 function pageReloaded() 25 function pageReloaded()
23 { 26 {
24 InspectorTest.invokePageFunctionAsync("display", displayDone); 27 InspectorTest.callFunctionInPageAsync("display").then(displayDone);
25 } 28 }
26 29
27 function displayDone() 30 function displayDone()
28 { 31 {
29 InspectorTest.stopTimeline(InspectorTest.safeWrap(finish)) 32 InspectorTest.stopTimeline(InspectorTest.safeWrap(finish))
30 } 33 }
31 34
32 function finish() 35 function finish()
33 { 36 {
34 InspectorTest.addResult("Model records:"); 37 InspectorTest.addResult("Model records:");
(...skipping 15 matching lines...) Expand all
50 </script> 53 </script>
51 </head> 54 </head>
52 55
53 <body onload="runTest()"> 56 <body onload="runTest()">
54 <p> 57 <p>
55 Tests the load event. 58 Tests the load event.
56 </p> 59 </p>
57 60
58 </body> 61 </body>
59 </html> 62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698