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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-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: 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 changeStylesAndDisplay(callback) 7 function changeStylesAndDisplay()
8 { 8 {
9 var callback;
10 var promise = new Promise((fulfill) => callback = fulfill);
9 requestAnimationFrame(function() { 11 requestAnimationFrame(function() {
10 document.getElementById("testElementOne").style.color = "red"; 12 document.getElementById("testElementOne").style.color = "red";
11 document.getElementById("testElementTwo").style.color = "blue"; 13 document.getElementById("testElementTwo").style.color = "blue";
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;
caseq 2016/08/05 17:56:43 replace with generateFrames
kozy 2016/08/10 01:21:15 Done.
16 } 19 }
17 20
18 function changeMultipleStylesAndDisplay(callback) 21 function changeMultipleStylesAndDisplay()
19 { 22 {
23 var callback;
24 var promise = new Promise((fulfill) => callback = fulfill);
20 requestAnimationFrame(function() { 25 requestAnimationFrame(function() {
21 var elementOne = document.getElementById("testElementOne"); 26 var elementOne = document.getElementById("testElementOne");
22 var elementTwo = document.getElementById("testElementTwo"); 27 var elementTwo = document.getElementById("testElementTwo");
23 var elementThree = document.getElementById("testElementThree"); 28 var elementThree = document.getElementById("testElementThree");
24 29
25 elementOne.style.backgroundColor = "orangered"; 30 elementOne.style.backgroundColor = "orangered";
26 var forceStyleRecalc1 = document.body.offsetTop; 31 var forceStyleRecalc1 = document.body.offsetTop;
27 elementOne.style.color = "mediumvioletred"; 32 elementOne.style.color = "mediumvioletred";
28 elementTwo.style.color = "deepskyblue"; 33 elementTwo.style.color = "deepskyblue";
29 var forceStyleRecalc2 = document.body.offsetTop; 34 var forceStyleRecalc2 = document.body.offsetTop;
30 elementOne.style.color = "tomato"; 35 elementOne.style.color = "tomato";
31 elementTwo.style.color = "mediumslateblue"; 36 elementTwo.style.color = "mediumslateblue";
32 elementThree.style.color = "mediumspringgreen"; 37 elementThree.style.color = "mediumspringgreen";
33 var forceStyleRecalc3 = document.body.offsetTop; 38 var forceStyleRecalc3 = document.body.offsetTop;
34 39
35 if (window.testRunner) 40 if (window.testRunner)
36 testRunner.layoutAndPaintAsyncThen(callback); 41 testRunner.layoutAndPaintAsyncThen(callback);
37 }); 42 });
43 return promise;
caseq 2016/08/05 17:56:43 ditto
kozy 2016/08/10 01:21:15 Done.
38 } 44 }
39 45
40 function changeSubframeStylesAndDisplay(callback) 46 function changeSubframeStylesAndDisplay()
41 { 47 {
48 var callback;
49 var promise = new Promise((fulfill) => callback = fulfill);
42 requestAnimationFrame(function() { 50 requestAnimationFrame(function() {
43 frames[0].document.body.style.backgroundColor = "papayawhip"; 51 frames[0].document.body.style.backgroundColor = "papayawhip";
44 frames[0].document.body.children[0].style.width = "200px"; 52 frames[0].document.body.children[0].style.width = "200px";
45 var forceLayout = frames[0].document.body.offsetTop; 53 var forceLayout = frames[0].document.body.offsetTop;
46 if (window.testRunner) 54 if (window.testRunner)
47 testRunner.layoutAndPaintAsyncThen(callback); 55 testRunner.layoutAndPaintAsyncThen(callback);
48 }); 56 });
57 return promise;
caseq 2016/08/05 17:56:43 ditto
kozy 2016/08/10 01:21:15 Done.
49 } 58 }
50 59
51 function test() 60 function test()
52 { 61 {
53 var currentPanel = WebInspector.inspectorView.currentPanel(); 62 var currentPanel = WebInspector.inspectorView.currentPanel();
54 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); 63 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline.");
55 Runtime.experiments.enableForTest("timelineInvalidationTracking"); 64 Runtime.experiments.enableForTest("timelineInvalidationTracking");
56 65
57 InspectorTest.runTestSuite([ 66 InspectorTest.runTestSuite([
58 function testLocalFrame(next) 67 function testLocalFrame(next)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 ]); 102 ]);
94 } 103 }
95 </script> 104 </script>
96 </head> 105 </head>
97 <body onload="runTest()"> 106 <body onload="runTest()">
98 <p>Tests the Timeline API instrumentation of style recalc events with invalidati ons.</p> 107 <p>Tests the Timeline API instrumentation of style recalc events with invalidati ons.</p>
99 <div id="testElementOne">PASS</div><div id="testElementTwo">PASS</div><div id="t estElementThree">PASS</div> 108 <div id="testElementOne">PASS</div><div id="testElementTwo">PASS</div><div id="t estElementThree">PASS</div>
100 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> 109 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>
101 </body> 110 </body>
102 </html> 111 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698