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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/timeline/timeline-raf.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 type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script type="text/javascript" src="../../http/tests/inspector-protocol/tracing- test.js"></script> 4 <script type="text/javascript" src="../../http/tests/inspector-protocol/tracing- 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 var rafId1 = requestAnimationFrame(function() 11 var rafId1 = requestAnimationFrame(function()
10 { 12 {
11 evaluateInFrontend("InspectorTest.testFunctionRequestAnimationFrame(" + rafId1 + ", " + rafId2 + ")"); 13 evaluateInFrontend("InspectorTest.testFunctionRequestAnimationFrame(" + rafId1 + ", " + rafId2 + ")");
caseq 2016/08/05 17:56:42 nit: this could be re-written in a much better way
kozy 2016/08/10 01:21:14 Done.
12 callback(); 14 callback();
13 }); 15 });
14 16
15 var rafId2 = requestAnimationFrame(function() { }); 17 var rafId2 = requestAnimationFrame(function() { });
16 cancelAnimationFrame(rafId2); 18 cancelAnimationFrame(rafId2);
19 return promise;
17 } 20 }
18 21
19 function test() 22 function test()
20 { 23 {
21 InspectorTest.invokeAsyncWithTracing("performActions", finish); 24 InspectorTest.invokeAsyncWithTracing("performActions", finish);
22 25
23 var firedRaf; 26 var firedRaf;
24 var canceledRaf; 27 var canceledRaf;
25 InspectorTest.testFunctionRequestAnimationFrame = function(rafId1, rafId2) 28 InspectorTest.testFunctionRequestAnimationFrame = function(rafId1, rafId2)
26 { 29 {
(...skipping 18 matching lines...) Expand all
45 InspectorTest.log("SUCCESS: found all expected events."); 48 InspectorTest.log("SUCCESS: found all expected events.");
46 InspectorTest.completeTest(); 49 InspectorTest.completeTest();
47 } 50 }
48 } 51 }
49 </script> 52 </script>
50 </head> 53 </head>
51 <body onLoad="runTest();"> 54 <body onLoad="runTest();">
52 <div id="myDiv">DIV</div> 55 <div id="myDiv">DIV</div>
53 </body> 56 </body>
54 </html> 57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698