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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-and-multiple-style-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 multipleStyleRecalcsAndDisplay(callback) 7 function multipleStyleRecalcsAndDisplay()
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.getElementById("testElementOne").className = "red"; 12 document.getElementById("testElementOne").className = "red";
11 var forceStyleRecalc1 = document.body.offsetTop; 13 var forceStyleRecalc1 = document.body.offsetTop;
12 document.getElementById("testElementOne").className = "snow"; 14 document.getElementById("testElementOne").className = "snow";
13 var forceStyleRecalc2 = document.body.offsetTop; 15 var forceStyleRecalc2 = document.body.offsetTop;
14 if (window.testRunner) 16 if (window.testRunner)
15 testRunner.layoutAndPaintAsyncThen(callback); 17 testRunner.layoutAndPaintAsyncThen(callback);
16 }); 18 });
19 return promise;
17 } 20 }
18 21
19 22
20 function test() 23 function test()
21 { 24 {
22 var currentPanel = WebInspector.inspectorView.currentPanel(); 25 var currentPanel = WebInspector.inspectorView.currentPanel();
23 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); 26 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline.");
24 Runtime.experiments.enableForTest("timelineInvalidationTracking"); 27 Runtime.experiments.enableForTest("timelineInvalidationTracking");
25 InspectorTest.invokeAsyncWithTimeline("multipleStyleRecalcsAndDisplay", test MultipleStyleRecalcs); 28 InspectorTest.invokeAsyncWithTimeline("multipleStyleRecalcsAndDisplay", test MultipleStyleRecalcs);
26 29
(...skipping 25 matching lines...) Expand all
52 .testHolder > .snow .dummy { } 55 .testHolder > .snow .dummy { }
53 </style> 56 </style>
54 </head> 57 </head>
55 <body onload="runTest()"> 58 <body onload="runTest()">
56 <p>Tests the Timeline API instrumentation of multiple style recalc invalidations and ensures they are all collected on the paint event.</p> 59 <p>Tests the Timeline API instrumentation of multiple style recalc invalidations and ensures they are all collected on the paint event.</p>
57 <div class="testHolder"> 60 <div class="testHolder">
58 <div id="testElementOne">PASS</div><div id="testElementTwo">PASS</div><div id="t estElementThree">PASS</div> 61 <div id="testElementOne">PASS</div><div id="testElementTwo">PASS</div><div id="t estElementThree">PASS</div>
59 </div> 62 </div>
60 </body> 63 </body>
61 </html> 64 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698