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

Side by Side Diff: LayoutTests/inspector/elements/hide-shortcut.html

Issue 1310883002: DevTools: represent ComputedStyle with simple Map (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
« no previous file with comments | « no previous file | Source/devtools/front_end/audits/AuditRules.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/elements-test.js"></script> 4 <script src="../../http/tests/inspector/elements-test.js"></script>
5 <script> 5 <script>
6 6
7 function pseudoVisibility(resolve, reject, pseudo) 7 function pseudoVisibility(resolve, reject, pseudo)
8 { 8 {
9 var parentNode = document.getElementById("parent-node"); 9 var parentNode = document.getElementById("parent-node");
10 resolve(getComputedStyle(parentNode, ":" + pseudo).visibility); 10 resolve(getComputedStyle(parentNode, ":" + pseudo).visibility);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 function callback() 56 function callback()
57 { 57 {
58 InspectorTest.addResult("=== Added hide shortcut ==="); 58 InspectorTest.addResult("=== Added hide shortcut ===");
59 InspectorTest.cssModel.computedStylePromise(parentNode.id).then( callback2); 59 InspectorTest.cssModel.computedStylePromise(parentNode.id).then( callback2);
60 } 60 }
61 61
62 function callback2(style) 62 function callback2(style)
63 { 63 {
64 InspectorTest.addResult("=== Parent node is hidden ==="); 64 InspectorTest.addResult("=== Parent node is hidden ===");
65 InspectorTest.addResult(style.getLiveProperty("visibility").prop ertyText); 65 InspectorTest.addResult(getPropertyText(style, "visibility"));
pfeldman 2015/08/24 17:48:01 This patch does not apply.
pfeldman 2015/08/24 20:55:50 A new question: how is this related?
66 InspectorTest.cssModel.computedStylePromise(childNode.id).then(c allback3); 66 InspectorTest.cssModel.computedStylePromise(childNode.id).then(c allback3);
67 } 67 }
68 68
69 function callback3(style) 69 function callback3(style)
70 { 70 {
71 InspectorTest.addResult("=== Child node is hidden ==="); 71 InspectorTest.addResult("=== Child node is hidden ===");
72 InspectorTest.addResult(style.getLiveProperty("visibility").prop ertyText); 72 InspectorTest.addResult(getPropertyText(style, "visibility"));
73 next(); 73 next();
74 } 74 }
75 }, 75 },
76 76
77 function testToggleHideShortcutOff(next) 77 function testToggleHideShortcutOff(next)
78 { 78 {
79 treeOutline.toggleHideElement(parentNode, callback); 79 treeOutline.toggleHideElement(parentNode, callback);
80 80
81 function callback() 81 function callback()
82 { 82 {
83 InspectorTest.addResult("=== Removed hide shortcut ==="); 83 InspectorTest.addResult("=== Removed hide shortcut ===");
84 InspectorTest.cssModel.computedStylePromise(parentNode.id).then( callback2); 84 InspectorTest.cssModel.computedStylePromise(parentNode.id).then( callback2);
85 } 85 }
86 86
87 function callback2(style) 87 function callback2(style)
88 { 88 {
89 InspectorTest.addResult("=== Parent node is visible ==="); 89 InspectorTest.addResult("=== Parent node is visible ===");
90 InspectorTest.addResult(style.getLiveProperty("visibility").prop ertyText); 90 InspectorTest.addResult(getPropertyText(style, "visibility"));
91 InspectorTest.cssModel.computedStylePromise(childNode.id).then(c allback3); 91 InspectorTest.cssModel.computedStylePromise(childNode.id).then(c allback3);
92 } 92 }
93 93
94 function callback3(style) 94 function callback3(style)
95 { 95 {
96 InspectorTest.addResult("=== Child node is visible ==="); 96 InspectorTest.addResult("=== Child node is visible ===");
97 InspectorTest.addResult(style.getLiveProperty("visibility").prop ertyText); 97 InspectorTest.addResult(getPropertyText(style, "visibility"));
98 next(); 98 next();
99 } 99 }
100 }, 100 },
101 101
102 function testToggleHideBeforePseudoShortcutOn(next) 102 function testToggleHideBeforePseudoShortcutOn(next)
103 { 103 {
104 testPseudoToggle(parentNode.beforePseudoElement(), next); 104 testPseudoToggle(parentNode.beforePseudoElement(), next);
105 }, 105 },
106 106
107 function testToggleHideAfterPseudoShortcutOn(next) 107 function testToggleHideAfterPseudoShortcutOn(next)
(...skipping 20 matching lines...) Expand all
128 InspectorTest.invokePageFunctionPromise("pseudoIframeVisibility" , []).then(function(result) { 128 InspectorTest.invokePageFunctionPromise("pseudoIframeVisibility" , []).then(function(result) {
129 InspectorTest.addResult("=== Added hide shortcut in frame == ="); 129 InspectorTest.addResult("=== Added hide shortcut in frame == =");
130 InspectorTest.addResult("=== Frame node is hidden ==="); 130 InspectorTest.addResult("=== Frame node is hidden ===");
131 InspectorTest.addResult("visibility: " + result + ";"); 131 InspectorTest.addResult("visibility: " + result + ";");
132 next(); 132 next();
133 }); 133 });
134 } 134 }
135 } 135 }
136 ]); 136 ]);
137 137
138 function getPropertyText(computedStyle, propertyName)
139 {
140 return String.sprintf("%s: %s;", propertyName, computedStyle.get(propert yName));
141 }
142
138 function testPseudoToggle(pseudoNode, next) 143 function testPseudoToggle(pseudoNode, next)
139 { 144 {
140 treeOutline.toggleHideElement(pseudoNode, callback); 145 treeOutline.toggleHideElement(pseudoNode, callback);
141 function callback() 146 function callback()
142 { 147 {
143 InspectorTest.invokePageFunctionPromise("pseudoVisibility", [pseudoN ode.pseudoType()]).then(function(result) { 148 InspectorTest.invokePageFunctionPromise("pseudoVisibility", [pseudoN ode.pseudoType()]).then(function(result) {
144 InspectorTest.addResult("::" + pseudoNode.pseudoType() + " node visibility: '" + result + "'"); 149 InspectorTest.addResult("::" + pseudoNode.pseudoType() + " node visibility: '" + result + "'");
145 next(); 150 next();
146 }); 151 });
147 } 152 }
(...skipping 20 matching lines...) Expand all
168 <div id="parent-node">parent 173 <div id="parent-node">parent
169 <div style="visibility:hidden">hidden 174 <div style="visibility:hidden">hidden
170 <div id="child-node" style="visibility:visible">child</div> 175 <div id="child-node" style="visibility:visible">child</div>
171 </div> 176 </div>
172 </div> 177 </div>
173 178
174 <iframe src="resources/hide-shortcut-iframe.html" onload="runTest()"> 179 <iframe src="resources/hide-shortcut-iframe.html" onload="runTest()">
175 180
176 </body> 181 </body>
177 </html> 182 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/audits/AuditRules.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698