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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-grouped-invalidations.html

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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() 7 function display()
8 { 8 {
9 var callback; 9 var callback;
10 var promise = new Promise((fulfill) => callback = fulfill); 10 var promise = new Promise((fulfill) => callback = fulfill);
11 requestAnimationFrame(function() { 11 requestAnimationFrame(function() {
12 var testElements = document.body.getElementsByClassName("testElement"); 12 var testElements = document.body.getElementsByClassName("testElement");
13 for (var i = 0; i < testElements.length; i++) { 13 for (var i = 0; i < testElements.length; i++) {
14 testElements[i].style.color = "red"; 14 testElements[i].style.color = "red";
15 testElements[i].style.backgroundColor = "blue"; 15 testElements[i].style.backgroundColor = "blue";
16 } 16 }
17 if (window.testRunner) 17 if (window.testRunner)
18 testRunner.layoutAndPaintAsyncThen(callback); 18 testRunner.layoutAndPaintAsyncThen(callback);
19 }); 19 });
20 return promise; 20 return promise;
21 } 21 }
22 22
23 function test() 23 function test()
24 { 24 {
25 Runtime.experiments.enableForTest("timelineInvalidationTracking"); 25 Runtime.experiments.enableForTest("timelineInvalidationTracking");
26 26
27 InspectorTest.invokeAsyncWithTimeline("display", function() { 27 InspectorTest.invokeAsyncWithTimeline("display", function() {
28 var record = InspectorTest.findFirstTimelineRecord(WebInspector.Timeline Model.RecordType.Paint); 28 var record = InspectorTest.findFirstTimelineRecord(TimelineModel.Timelin eModel.RecordType.Paint);
29 InspectorTest.addArray(WebInspector.InvalidationTracker.invalidationEven tsFor(record._event), InspectorTest.InvalidationFormatters, "", "paint invalidat ions"); 29 InspectorTest.addArray(TimelineModel.InvalidationTracker.invalidationEve ntsFor(record._event), InspectorTest.InvalidationFormatters, "", "paint invalida tions");
30 30
31 var linkifier = new WebInspector.Linkifier(); 31 var linkifier = new Components.Linkifier();
32 var event = record.traceEvent(); 32 var event = record.traceEvent();
33 var target = InspectorTest.timelineModel().targetByEvent(event); 33 var target = InspectorTest.timelineModel().targetByEvent(event);
34 var contentHelper = new WebInspector.TimelineDetailsContentHelper(target , linkifier, true); 34 var contentHelper = new Timeline.TimelineDetailsContentHelper(target, li nkifier, true);
35 WebInspector.TimelineUIUtils._generateCauses(event, target, null, conten tHelper); 35 Timeline.TimelineUIUtils._generateCauses(event, target, null, contentHel per);
36 var invalidationsTree = contentHelper.element.getElementsByClassName("in validations-tree")[0]; 36 var invalidationsTree = contentHelper.element.getElementsByClassName("in validations-tree")[0];
37 var invalidations = invalidationsTree.shadowRoot.textContent; 37 var invalidations = invalidationsTree.shadowRoot.textContent;
38 checkStringContains(invalidations, "Inline CSS style declaration was mut ated for [ DIV class='testElement' ], [ DIV class='testElement' ], and 2 others. (anonymous) @ timeline-grouped-invalidations.html:14"); 38 checkStringContains(invalidations, "Inline CSS style declaration was mut ated for [ DIV class='testElement' ], [ DIV class='testElement' ], and 2 others. (anonymous) @ timeline-grouped-invalidations.html:14");
39 checkStringContains(invalidations, "Inline CSS style declaration was mut ated for [ DIV class='testElement' ], [ DIV class='testElement' ], and 2 others. (anonymous) @ timeline-grouped-invalidations.html:15"); 39 checkStringContains(invalidations, "Inline CSS style declaration was mut ated for [ DIV class='testElement' ], [ DIV class='testElement' ], and 2 others. (anonymous) @ timeline-grouped-invalidations.html:15");
40 InspectorTest.completeTest(); 40 InspectorTest.completeTest();
41 }); 41 });
42 42
43 function checkStringContains(string, contains) 43 function checkStringContains(string, contains)
44 { 44 {
45 var doesContain = string.indexOf(contains) >= 0; 45 var doesContain = string.indexOf(contains) >= 0;
46 InspectorTest.check(doesContain, contains + " should be present in " + s tring); 46 InspectorTest.check(doesContain, contains + " should be present in " + s tring);
47 InspectorTest.addResult("PASS - record contained " + contains); 47 InspectorTest.addResult("PASS - record contained " + contains);
48 } 48 }
49 } 49 }
50 </script> 50 </script>
51 </head> 51 </head>
52 <body onload="runTest()"> 52 <body onload="runTest()">
53 <p>Tests grouped invalidations on the timeline.</p> 53 <p>Tests grouped invalidations on the timeline.</p>
54 <div class="testElement">P</div><div class="testElement">A</div> 54 <div class="testElement">P</div><div class="testElement">A</div>
55 <div class="testElement">S</div><div class="testElement">S</div> 55 <div class="testElement">S</div><div class="testElement">S</div>
56 </body> 56 </body>
57 </html> 57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698