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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-gc-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 6
7 function produceGarbageForGCEvents(callback) 7 function produceGarbageForGCEvents()
8 { 8 {
9 if (window.testRunner) { 9 if (window.testRunner) {
10 window.gc(); 10 window.gc();
11 testRunner.layoutAndPaintAsyncThen(callback); 11 return new Promise((fulfill) => testRunner.layoutAndPaintAsyncThen(fulfi ll));
12 } 12 }
13 return Promise.reject();
13 } 14 }
14 15
15 function test() 16 function test()
16 { 17 {
17 InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate) ; 18 InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate) ;
18 19
19 function validate() 20 function validate()
20 { 21 {
21 var gcRecord = InspectorTest.findFirstTimelineRecord(WebInspector.Timeli neModel.RecordType.MajorGC) || InspectorTest.findFirstTimelineRecord(WebInspecto r.TimelineModel.RecordType.MinorGC) 22 var gcRecord = InspectorTest.findFirstTimelineRecord(WebInspector.Timeli neModel.RecordType.MajorGC) || InspectorTest.findFirstTimelineRecord(WebInspecto r.TimelineModel.RecordType.MinorGC)
22 if (gcRecord) 23 if (gcRecord)
23 InspectorTest.addResult("SUCCESS: Found expected GC event record"); 24 InspectorTest.addResult("SUCCESS: Found expected GC event record");
24 else 25 else
25 InspectorTest.addResult("FAIL: GC event record wasn't found"); 26 InspectorTest.addResult("FAIL: GC event record wasn't found");
26 InspectorTest.completeTest(); 27 InspectorTest.completeTest();
27 } 28 }
28 } 29 }
29 30
30 </script> 31 </script>
31 </head> 32 </head>
32 33
33 <body onload="runTest()"> 34 <body onload="runTest()">
34 <p> 35 <p>
35 Tests the Timeline API instrumentation of a gc event 36 Tests the Timeline API instrumentation of a gc event
36 </p> 37 </p>
37 </body> 38 </body>
38 </html> 39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698