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

Side by Side Diff: LayoutTests/inspector/elements/styles/styles-formatting.html

Issue 881263002: DevTools: use target-based model accessors only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 <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/elements-test.js"></script> 5 <script src="../../../http/tests/inspector/elements-test.js"></script>
6 <script> 6 <script>
7 7
8 function test() 8 function test()
9 { 9 {
10 var formattedStyle; 10 var formattedStyle;
11 var unformattedStyle; 11 var unformattedStyle;
12 12
13 InspectorTest.runTestSuite([ 13 InspectorTest.runTestSuite([
14 function initFormattedStyle(next) 14 function initFormattedStyle(next)
15 { 15 {
16 function callback(styles) 16 function callback(styles)
17 { 17 {
18 if (!styles) { 18 if (!styles) {
19 InspectorTest.addResult("empty styles"); 19 InspectorTest.addResult("empty styles");
20 return; 20 return;
21 } 21 }
22 22
23 formattedStyle = styles.matchedCSSRules[1].style; 23 formattedStyle = styles.matchedCSSRules[1].style;
24 next(); 24 next();
25 } 25 }
26 26
27 function nodeCallback(node) 27 function nodeCallback(node)
28 { 28 {
29 WebInspector.cssModel.getMatchedStylesAsync(node.id, false, fals e, callback); 29 InspectorTest.cssModel.getMatchedStylesAsync(node.id, false, fal se, callback);
30 } 30 }
31 InspectorTest.selectNodeWithId("formatted", nodeCallback); 31 InspectorTest.selectNodeWithId("formatted", nodeCallback);
32 }, 32 },
33 33
34 function testFormattedInsertStart(next) 34 function testFormattedInsertStart(next)
35 { 35 {
36 formattedStyle.insertPropertyAt(0, "firstProperty", "firstValue", du mpFormattedAndCallNext.bind(null, next)); 36 formattedStyle.insertPropertyAt(0, "firstProperty", "firstValue", du mpFormattedAndCallNext.bind(null, next));
37 }, 37 },
38 38
39 function testFormattedRemoveStart(next) 39 function testFormattedRemoveStart(next)
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 InspectorTest.addResult("empty styles"); 114 InspectorTest.addResult("empty styles");
115 return; 115 return;
116 } 116 }
117 117
118 unformattedStyle = styles.matchedCSSRules[1].style; 118 unformattedStyle = styles.matchedCSSRules[1].style;
119 next(); 119 next();
120 } 120 }
121 121
122 function nodeCallback(node) 122 function nodeCallback(node)
123 { 123 {
124 WebInspector.cssModel.getMatchedStylesAsync(node.id, false, fals e, callback); 124 InspectorTest.cssModel.getMatchedStylesAsync(node.id, false, fal se, callback);
125 } 125 }
126 InspectorTest.selectNodeWithId("unformatted", nodeCallback); 126 InspectorTest.selectNodeWithId("unformatted", nodeCallback);
127 }, 127 },
128 128
129 function testUnformattedInsertStart(next) 129 function testUnformattedInsertStart(next)
130 { 130 {
131 unformattedStyle.insertPropertyAt(0, "firstProperty", "firstValue", dumpUnformattedAndCallNext.bind(null, next)); 131 unformattedStyle.insertPropertyAt(0, "firstProperty", "firstValue", dumpUnformattedAndCallNext.bind(null, next));
132 }, 132 },
133 133
134 function testUnformattedRemoveStart(next) 134 function testUnformattedRemoveStart(next)
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 </head> 239 </head>
240 240
241 <body id="mainBody" onload="runTest()"> 241 <body id="mainBody" onload="runTest()">
242 <p> 242 <p>
243 Tests that InspectorCSSAgent formats the CSS style text based on the CSS model m odifications. 243 Tests that InspectorCSSAgent formats the CSS style text based on the CSS model m odifications.
244 </p> 244 </p>
245 <div id="formatted">Formatted</div> 245 <div id="formatted">Formatted</div>
246 <div id="unformatted">Unformatted</div> 246 <div id="unformatted">Unformatted</div>
247 </body> 247 </body>
248 </html> 248 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698