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

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

Issue 1308663002: DevTools: simplify WI.CSSProperty and WI.CSSStyleDeclaration interfaces (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test Created 5 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 3
4 <link rel="stylesheet" href="../styles/resources/styles-history.css"> 4 <link rel="stylesheet" href="../styles/resources/styles-history.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 src="../../../http/tests/inspector/resources-test.js"></script> 8 <script src="../../../http/tests/inspector/resources-test.js"></script>
9 <script src="../styles/styles-test.js"></script> 9 <script src="../styles/styles-test.js"></script>
10 <script> 10 <script>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 } 58 }
59 }, 59 },
60 60
61 function testSetContentViaModelMinor(next) 61 function testSetContentViaModelMinor(next)
62 { 62 {
63 styleSheetForResource(step1); 63 styleSheetForResource(step1);
64 64
65 function step1(style) 65 function step1(style)
66 { 66 {
67 var property = style.getLiveProperty("margin"); 67 var property = getLiveProperty(style, "margin");
68 property.setText("margin:25px;", false, true).then(dumpHisto ry(next)); 68 property.setText("margin:25px;", false, true).then(dumpHisto ry(next));
69 } 69 }
70 }, 70 },
71 71
72 function testSetContentViaModelMajor(next) 72 function testSetContentViaModelMajor(next)
73 { 73 {
74 styleSheetForResource(step1); 74 styleSheetForResource(step1);
75 75
76 function step1(style) 76 function step1(style)
77 { 77 {
78 var property = style.getLiveProperty("margin"); 78 var property = getLiveProperty(style, "margin");
79 InspectorTest.addSniffer(WebInspector.UISourceCode.prototype , "addRevision", dumpHistory(next)); 79 InspectorTest.addSniffer(WebInspector.UISourceCode.prototype , "addRevision", dumpHistory(next));
80 property.setText("margin:30px;", true, true); 80 property.setText("margin:30px;", true, true);
81 } 81 }
82 } 82 }
83 ]); 83 ]);
84 } 84 }
85 85
86 function styleSheetForResource(callback) 86 function styleSheetForResource(callback)
87 { 87 {
88 InspectorTest.nodeWithId("mainBody", onNodeSelected); 88 InspectorTest.nodeWithId("mainBody", onNodeSelected);
(...skipping 28 matching lines...) Expand all
117 { 117 {
118 InspectorTest.addResult("History length: " + uiSourceCode.history.le ngth); 118 InspectorTest.addResult("History length: " + uiSourceCode.history.le ngth);
119 for (var i = 0; i < uiSourceCode.history.length; ++i) { 119 for (var i = 0; i < uiSourceCode.history.length; ++i) {
120 InspectorTest.addResult("Item " + i + ":"); 120 InspectorTest.addResult("Item " + i + ":");
121 InspectorTest.addResult(uiSourceCode.history[i].content); 121 InspectorTest.addResult(uiSourceCode.history[i].content);
122 } 122 }
123 next(); 123 next();
124 } 124 }
125 return result; 125 return result;
126 } 126 }
127
128 function getLiveProperty(style, name)
129 {
130 for (var property of style.allProperties) {
131 if (!property.activeInStyle())
132 continue;
133 if (property.name === name)
134 return property;
135 }
136 return null;
137 }
127 } 138 }
128 139
129 </script> 140 </script>
130 </head> 141 </head>
131 142
132 <body id="mainBody" onload="runTest()"> 143 <body id="mainBody" onload="runTest()">
133 <p> 144 <p>
134 Tests resources panel history. 145 Tests resources panel history.
135 </p> 146 </p>
136 </body> 147 </body>
137 </html> 148 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698