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

Side by Side Diff: tracing/tracing/ui/base/ui_test.html

Issue 1925993003: [polymer] Replaces lots of HTMLUnknownElements with HTMLDivElements (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Created 4 years, 7 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. 3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/ui/base/ui.html"> 8 <link rel="import" href="/tracing/ui/base/ui.html">
9 9
10 <script> 10 <script>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 assert.equal(argsDecoratingChild.second, 'and second'); 184 assert.equal(argsDecoratingChild.second, 'and second');
185 assert.isTrue(argsDecoratingChild.argsDecoratingChildDecorated); 185 assert.isTrue(argsDecoratingChild.argsDecoratingChildDecorated);
186 assert.isTrue(argsDecoratingChild.argsDecorated); 186 assert.isTrue(argsDecoratingChild.argsDecorated);
187 assert.isUndefined(argsDecoratingChild.noArgsDecorated); 187 assert.isUndefined(argsDecoratingChild.noArgsDecorated);
188 }); 188 });
189 189
190 test('defineWithNamespace', function() { 190 test('defineWithNamespace', function() {
191 var svgNS = 'http://www.w3.org/2000/svg'; 191 var svgNS = 'http://www.w3.org/2000/svg';
192 var cls = tr.ui.b.define('svg', undefined, svgNS); 192 var cls = tr.ui.b.define('svg', undefined, svgNS);
193 cls.prototype = { 193 cls.prototype = {
194 __proto__: HTMLUnknownElement.prototype, 194 __proto__: HTMLDivElement.prototype,
195 195
196 decorate: function() { 196 decorate: function() {
197 this.setAttribute('width', 200); 197 this.setAttribute('width', 200);
198 this.setAttribute('height', 200); 198 this.setAttribute('height', 200);
199 this.setAttribute('viewPort', '0 0 200 200'); 199 this.setAttribute('viewPort', '0 0 200 200');
200 var rectEl = document.createElementNS(svgNS, 'rect'); 200 var rectEl = document.createElementNS(svgNS, 'rect');
201 rectEl.setAttribute('x', 10); 201 rectEl.setAttribute('x', 10);
202 rectEl.setAttribute('y', 10); 202 rectEl.setAttribute('y', 10);
203 rectEl.setAttribute('width', 180); 203 rectEl.setAttribute('width', 180);
204 rectEl.setAttribute('height', 180); 204 rectEl.setAttribute('height', 180);
205 Polymer.dom(this).appendChild(rectEl); 205 Polymer.dom(this).appendChild(rectEl);
206 } 206 }
207 }; 207 };
208 var el = new cls(); 208 var el = new cls();
209 assert.equal(el.tagName, 'svg'); 209 assert.equal(el.tagName, 'svg');
210 assert.equal(el.namespaceURI, svgNS); 210 assert.equal(el.namespaceURI, svgNS);
211 this.addHTMLOutput(el); 211 this.addHTMLOutput(el);
212 }); 212 });
213 213
214 test('defineSubclassWithNamespace', function() { 214 test('defineSubclassWithNamespace', function() {
215 var svgNS = 'http://www.w3.org/2000/svg'; 215 var svgNS = 'http://www.w3.org/2000/svg';
216 var cls = tr.ui.b.define('svg', undefined, svgNS); 216 var cls = tr.ui.b.define('svg', undefined, svgNS);
217 cls.prototype = { 217 cls.prototype = {
218 __proto__: HTMLUnknownElement.prototype, 218 __proto__: HTMLDivElement.prototype,
219 219
220 decorate: function() { 220 decorate: function() {
221 this.setAttribute('width', 200); 221 this.setAttribute('width', 200);
222 this.setAttribute('height', 200); 222 this.setAttribute('height', 200);
223 this.setAttribute('viewPort', '0 0 200 200'); 223 this.setAttribute('viewPort', '0 0 200 200');
224 var rectEl = document.createElementNS(svgNS, 'rect'); 224 var rectEl = document.createElementNS(svgNS, 'rect');
225 rectEl.setAttribute('x', 10); 225 rectEl.setAttribute('x', 10);
226 rectEl.setAttribute('y', 10); 226 rectEl.setAttribute('y', 10);
227 rectEl.setAttribute('width', 180); 227 rectEl.setAttribute('width', 180);
228 rectEl.setAttribute('height', 180); 228 rectEl.setAttribute('height', 180);
229 Polymer.dom(this).appendChild(rectEl); 229 Polymer.dom(this).appendChild(rectEl);
230 } 230 }
231 }; 231 };
232 232
233 var subCls = tr.ui.b.define('sub', cls); 233 var subCls = tr.ui.b.define('sub', cls);
234 subCls.prototype = { 234 subCls.prototype = {
235 __proto__: cls.prototype 235 __proto__: cls.prototype
236 }; 236 };
237 assert.equal(subCls.toString(), 'svg::sub'); 237 assert.equal(subCls.toString(), 'svg::sub');
238 238
239 var el = new subCls(); 239 var el = new subCls();
240 this.addHTMLOutput(el); 240 this.addHTMLOutput(el);
241 assert.equal(el.tagName, 'svg'); 241 assert.equal(el.tagName, 'svg');
242 assert.equal(el.namespaceURI, svgNS); 242 assert.equal(el.namespaceURI, svgNS);
243 }); 243 });
244 }); 244 });
245 </script> 245 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/base/quad_stack_view.html ('k') | tracing/tracing/ui/extras/about_tracing/profiling_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698