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

Side by Side Diff: LayoutTests/inspector/timeline/timeline-paint.html

Issue 461323003: DevTools: Make Timeline tests use only model records (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script> 4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script> 5 <script>
6 6
7 function display(callback) 7 function display(callback)
8 { 8 {
9 requestAnimationFrame(function() { 9 requestAnimationFrame(function() {
10 document.body.style.backgroundColor = "blue"; 10 document.body.style.backgroundColor = "blue";
(...skipping 10 matching lines...) Expand all
21 testRunner.displayAsyncThen(callback); 21 testRunner.displayAsyncThen(callback);
22 }); 22 });
23 } 23 }
24 24
25 function test() 25 function test()
26 { 26 {
27 InspectorTest.invokeAsyncWithTimeline("display", step1); 27 InspectorTest.invokeAsyncWithTimeline("display", step1);
28 28
29 function step1(records) 29 function step1(records)
30 { 30 {
31 var filteredRecords = InspectorTest.filterTimelineRecords(WebInspector.T imelineModel.RecordType.Paint, true); 31 var record = InspectorTest.findFirstTimelineRecord(WebInspector.Timeline Model.RecordType.Paint);
32 if (filteredRecords.length) 32 if (record)
33 InspectorTest.printTimelineRecordProperties(filteredRecords[0]); 33 InspectorTest.printTimelineRecordProperties(record);
34 else 34 else
35 InspectorTest.addResult("FAIL: no paint record found"); 35 InspectorTest.addResult("FAIL: no paint record found");
36 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", step3) ; 36 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", step3) ;
37 } 37 }
38 38
39 function step3(records) 39 function step3(records)
40 { 40 {
41 var filteredRecords = InspectorTest.filterTimelineRecords(WebInspector.T imelineModel.RecordType.Paint, true); 41 var paintRecord = InspectorTest.findFirstTimelineRecord(WebInspector.Tim elineModel.RecordType.Paint);
42 var paintRecord;
43 for (var i = 0; i < filteredRecords.length; ++i) {
44 var record = filteredRecords[i];
45 if (record.children && record.children.length) {
46 paintRecord = record;
47 break;
48 }
49 }
50 InspectorTest.assertTrue(paintRecord, "Paint record with subframe paint not found"); 42 InspectorTest.assertTrue(paintRecord, "Paint record with subframe paint not found");
51 var topQuad = paintRecord.data.clip; 43 var topQuad = paintRecord.data().clip;
52 var subframePaint = paintRecord.children[0]; 44 var subframePaint = paintRecord.children()[0];
53 var subframeQuad = subframePaint.data.clip; 45 var subframeQuad = subframePaint.data().clip;
54 InspectorTest.assertEquals(8, topQuad.length); 46 InspectorTest.assertEquals(8, topQuad.length);
55 InspectorTest.assertEquals(8, subframeQuad.length); 47 InspectorTest.assertEquals(8, subframeQuad.length);
56 InspectorTest.assertGreaterOrEqual(subframeQuad[0], topQuad[0]); 48 InspectorTest.assertGreaterOrEqual(subframeQuad[0], topQuad[0]);
57 InspectorTest.assertGreaterOrEqual(subframeQuad[1], topQuad[1]); 49 InspectorTest.assertGreaterOrEqual(subframeQuad[1], topQuad[1]);
58 InspectorTest.assertGreaterOrEqual(topQuad[2], subframeQuad[2]); 50 InspectorTest.assertGreaterOrEqual(topQuad[2], subframeQuad[2]);
59 InspectorTest.assertGreaterOrEqual(subframeQuad[3], topQuad[3]); 51 InspectorTest.assertGreaterOrEqual(subframeQuad[3], topQuad[3]);
60 InspectorTest.assertGreaterOrEqual(topQuad[4], subframeQuad[4]); 52 InspectorTest.assertGreaterOrEqual(topQuad[4], subframeQuad[4]);
61 InspectorTest.assertGreaterOrEqual(topQuad[5], subframeQuad[5]); 53 InspectorTest.assertGreaterOrEqual(topQuad[5], subframeQuad[5]);
62 InspectorTest.assertGreaterOrEqual(subframeQuad[6], topQuad[6]); 54 InspectorTest.assertGreaterOrEqual(subframeQuad[6], topQuad[6]);
63 InspectorTest.assertGreaterOrEqual(topQuad[7], subframeQuad[7]); 55 InspectorTest.assertGreaterOrEqual(topQuad[7], subframeQuad[7]);
64 56
65 InspectorTest.completeTest(); 57 InspectorTest.completeTest();
66 } 58 }
67 } 59 }
68 60
69 </script> 61 </script>
70 </head> 62 </head>
71 63
72 <body onload="runTest()"> 64 <body onload="runTest()">
73 <p> 65 <p>
74 Tests the Timeline API instrumentation of a paint event 66 Tests the Timeline API instrumentation of a paint event
75 </p> 67 </p>
76 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> 68 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe>
77 </body> 69 </body>
78 </html> 70 </html>
OLDNEW
« no previous file with comments | « LayoutTests/inspector/timeline/timeline-node-reference.html ('k') | LayoutTests/inspector/timeline/timeline-script-tag-1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698