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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations.html

Issue 2208963002: [DevTools] Removed InspectorTest.invokeFunctionInPageAsync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-promise-from-other-tests
Patch Set: fixed tests :( 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 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../http/tests/inspector/inspector-test.js"></script> 4 <script src="../../../http/tests/inspector/inspector-test.js"></script>
5 <script src="../../../http/tests/inspector/timeline-test.js"></script> 5 <script src="../../../http/tests/inspector/timeline-test.js"></script>
6 <script> 6 <script>
7 function display(callback) 7 function display()
8 { 8 {
9 var callback;
10 var promise = new Promise((fulfill) => callback = fulfill);
9 requestAnimationFrame(function() { 11 requestAnimationFrame(function() {
caseq 2016/08/10 22:44:55 remove rAF() and use waitForFrame()?
kozy 2016/08/11 01:34:17 Done.
10 document.body.style.backgroundColor = "blue"; 12 document.body.style.backgroundColor = "blue";
11 document.getElementById("testElement").style.width = "100px"; 13 document.getElementById("testElement").style.width = "100px";
12 var forceLayout = document.body.offsetTop; 14 var forceLayout = document.body.offsetTop;
13 if (window.testRunner) 15 if (window.testRunner)
14 testRunner.layoutAndPaintAsyncThen(callback); 16 testRunner.layoutAndPaintAsyncThen(callback);
15 }); 17 });
18 return promise;
16 } 19 }
17 20
18 function updateSubframeAndDisplay(callback) 21 function updateSubframeAndDisplay()
19 { 22 {
23 var callback;
24 var promise = new Promise((fulfill) => callback = fulfill);
20 requestAnimationFrame(function() { 25 requestAnimationFrame(function() {
21 frames[0].document.body.children[0].style.width = "200px"; 26 frames[0].document.body.children[0].style.width = "200px";
22 var forceLayout = frames[0].document.body.offsetTop; 27 var forceLayout = frames[0].document.body.offsetTop;
23 if (window.testRunner) 28 if (window.testRunner)
24 testRunner.layoutAndPaintAsyncThen(callback); 29 testRunner.layoutAndPaintAsyncThen(callback);
25 }); 30 });
31 return promise;
26 } 32 }
27 33
28 function test() 34 function test()
29 { 35 {
30 var currentPanel = WebInspector.inspectorView.currentPanel(); 36 var currentPanel = WebInspector.inspectorView.currentPanel();
31 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); 37 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline.");
32 Runtime.experiments.enableForTest("timelineInvalidationTracking"); 38 Runtime.experiments.enableForTest("timelineInvalidationTracking");
33 39
34 InspectorTest.runTestSuite([ 40 InspectorTest.runTestSuite([
35 function testLocalFrame(next) 41 function testLocalFrame(next)
(...skipping 24 matching lines...) Expand all
60 ]); 66 ]);
61 } 67 }
62 </script> 68 </script>
63 </head> 69 </head>
64 <body onload="runTest()"> 70 <body onload="runTest()">
65 <p>Tests the Timeline API instrumentation of paint events with layout invalidati ons.</p> 71 <p>Tests the Timeline API instrumentation of paint events with layout invalidati ons.</p>
66 <div id="testElement">PASS</div> 72 <div id="testElement">PASS</div>
67 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> 73 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>
68 </body> 74 </body>
69 </html> 75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698