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

Side by Side Diff: LayoutTests/inspector/elements/styles-4/styles-source-offsets.html

Issue 1196193016: DevTools: [CSS] promisify CSS domain (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 5 years, 6 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 3
4 <link rel="stylesheet" href="../styles/resources/styles-source-offsets.css"> 4 <link rel="stylesheet" href="../styles/resources/styles-source-offsets.css">
5 5
6 <script src="../../../http/tests/inspector/inspector-test.js"></script> 6 <script src="../../../http/tests/inspector/inspector-test.js"></script>
7 <script src="../../../http/tests/inspector/elements-test.js"></script> 7 <script src="../../../http/tests/inspector/elements-test.js"></script>
8 <script> 8 <script>
9 9
10 function test() 10 function test()
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 function matchedCallback(error, matchedCSSRules) 56 function matchedCallback(error, matchedCSSRules)
57 { 57 {
58 if (error) { 58 if (error) {
59 InspectorTest.addResult("error: " + error); 59 InspectorTest.addResult("error: " + error);
60 InspectorTest.completeTest(); 60 InspectorTest.completeTest();
61 return; 61 return;
62 } 62 }
63 resultStyles.matchedCSSRules = matchedCSSRules; 63 resultStyles.matchedCSSRules = matchedCSSRules;
64 step2();
65 } 64 }
66 65
67 function step1(node) 66 function step1(node)
68 { 67 {
69 InspectorTest.CSSAgent.getInlineStylesForNode(node.id, inlineCallback); 68 var promises = [
70 InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, matchedCallback) ; 69 InspectorTest.CSSAgent.getInlineStylesForNode(node.id, inlineCallbac k),
70 InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, matchedCallb ack)
71 ];
72 Promise.all(promises).then(step2);
71 } 73 }
72 74
73 function step2() 75 function step2()
74 { 76 {
75 var matchedCSSRules = resultStyles.matchedCSSRules; 77 var matchedCSSRules = resultStyles.matchedCSSRules;
76 for (var i = 0; i < matchedCSSRules.length; ++i) 78 for (var i = 0; i < matchedCSSRules.length; ++i)
77 dumpStyleData(matchedCSSRules[i].rule); 79 dumpStyleData(matchedCSSRules[i].rule);
78 dumpStyleData(resultStyles.inlineStyle); 80 dumpStyleData(resultStyles.inlineStyle);
79 InspectorTest.completeTest(); 81 InspectorTest.completeTest();
80 } 82 }
(...skipping 11 matching lines...) Expand all
92 </style> 94 </style>
93 </head> 95 </head>
94 96
95 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font- weight: normal; width: 80%"> 97 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font- weight: normal; width: 80%">
96 <p> 98 <p>
97 Tests that proper data and start/end offset positions are reported for CSS style declarations and properties. 99 Tests that proper data and start/end offset positions are reported for CSS style declarations and properties.
98 </p> 100 </p>
99 101
100 </body> 102 </body>
101 </html> 103 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698