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

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: 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 var callback;
10 var promise = new Promise((fulfill) => callback = fulfill);
9 if (window.testRunner) { 11 if (window.testRunner) {
10 window.gc(); 12 window.gc();
11 testRunner.layoutAndPaintAsyncThen(callback); 13 testRunner.layoutAndPaintAsyncThen(callback);
caseq 2016/08/05 17:56:42 ditto -- only return promise here and inline this
kozy 2016/08/10 01:21:14 Done.
12 } 14 }
15 return promise;
13 } 16 }
14 17
15 function test() 18 function test()
16 { 19 {
17 InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate) ; 20 InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate) ;
18 21
19 function validate() 22 function validate()
20 { 23 {
21 var gcRecord = InspectorTest.findFirstTimelineRecord(WebInspector.Timeli neModel.RecordType.MajorGC) || InspectorTest.findFirstTimelineRecord(WebInspecto r.TimelineModel.RecordType.MinorGC) 24 var gcRecord = InspectorTest.findFirstTimelineRecord(WebInspector.Timeli neModel.RecordType.MajorGC) || InspectorTest.findFirstTimelineRecord(WebInspecto r.TimelineModel.RecordType.MinorGC)
22 if (gcRecord) 25 if (gcRecord)
23 InspectorTest.addResult("SUCCESS: Found expected GC event record"); 26 InspectorTest.addResult("SUCCESS: Found expected GC event record");
24 else 27 else
25 InspectorTest.addResult("FAIL: GC event record wasn't found"); 28 InspectorTest.addResult("FAIL: GC event record wasn't found");
26 InspectorTest.completeTest(); 29 InspectorTest.completeTest();
27 } 30 }
28 } 31 }
29 32
30 </script> 33 </script>
31 </head> 34 </head>
32 35
33 <body onload="runTest()"> 36 <body onload="runTest()">
34 <p> 37 <p>
35 Tests the Timeline API instrumentation of a gc event 38 Tests the Timeline API instrumentation of a gc event
36 </p> 39 </p>
37 </body> 40 </body>
38 </html> 41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698