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

Side by Side Diff: tests/html/custom/document_register_basic_test.dart

Issue 33593003: Reapply remove upgradeCustomElement methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library document_register_basic_test; 5 library document_register_basic_test;
6 import 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 import 'package:unittest/html_config.dart'; 7 import 'package:unittest/html_config.dart';
8 import 'dart:html'; 8 import 'dart:html';
9 import '../utils.dart'; 9 import '../utils.dart';
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // Native method 84 // Native method
85 var childDiv = new DivElement(); 85 var childDiv = new DivElement();
86 createdFoo.append(childDiv); 86 createdFoo.append(childDiv);
87 expect(createdFoo.lastChild, childDiv); 87 expect(createdFoo.lastChild, childDiv);
88 88
89 // Parser initiated instantiation 89 // Parser initiated instantiation
90 var container = new DivElement()..id = "container"; 90 var container = new DivElement()..id = "container";
91 document.body.append(container); 91 document.body.append(container);
92 container.setInnerHtml("<x-foo></x-foo>", 92 container.setInnerHtml("<x-foo></x-foo>",
93 treeSanitizer: new NullTreeSanitizer()); 93 treeSanitizer: new NullTreeSanitizer());
94 Platform.upgradeCustomElements(container); 94 upgradeCustomElements(container);
95 var parsedFoo = container.firstChild; 95 var parsedFoo = container.firstChild;
96 96
97 expect(parsedFoo is Foo, isTrue); 97 expect(parsedFoo is Foo, isTrue);
98 expect(parsedFoo.tagName, "X-FOO"); 98 expect(parsedFoo.tagName, "X-FOO");
99 99
100 // Ensuring the wrapper is retained 100 // Ensuring the wrapper is retained
101 var someProperty = new Expando(); 101 var someProperty = new Expando();
102 someProperty[parsedFoo] = "hello"; 102 someProperty[parsedFoo] = "hello";
103 expect(container.firstChild, parsedFoo); 103 expect(container.firstChild, parsedFoo);
104 expect(someProperty[container.firstChild], someProperty[parsedFoo]); 104 expect(someProperty[container.firstChild], someProperty[parsedFoo]);
(...skipping 15 matching lines...) Expand all
120 // With irregular cases 120 // With irregular cases
121 var createdUpperBar = new Element.tag("X-BAR"); 121 var createdUpperBar = new Element.tag("X-BAR");
122 var createdMixedBar = new Element.tag("X-Bar"); 122 var createdMixedBar = new Element.tag("X-Bar");
123 expect(createdUpperBar is Bar, isTrue); 123 expect(createdUpperBar is Bar, isTrue);
124 expect(createdUpperBar.tagName, "X-BAR"); 124 expect(createdUpperBar.tagName, "X-BAR");
125 expect(createdMixedBar is Bar, isTrue); 125 expect(createdMixedBar is Bar, isTrue);
126 expect(createdMixedBar.tagName, "X-BAR"); 126 expect(createdMixedBar.tagName, "X-BAR");
127 127
128 container.setInnerHtml("<X-BAR></X-BAR><X-Bar></X-Bar>", 128 container.setInnerHtml("<X-BAR></X-BAR><X-Bar></X-Bar>",
129 treeSanitizer: new NullTreeSanitizer()); 129 treeSanitizer: new NullTreeSanitizer());
130 Platform.upgradeCustomElements(container); 130 upgradeCustomElements(container);
131 expect(container.firstChild is Bar, isTrue); 131 expect(container.firstChild is Bar, isTrue);
132 expect(container.firstChild.tagName, "X-BAR"); 132 expect(container.firstChild.tagName, "X-BAR");
133 expect(container.lastChild is Bar, isTrue); 133 expect(container.lastChild is Bar, isTrue);
134 expect(container.lastChild.tagName, "X-BAR"); 134 expect(container.lastChild.tagName, "X-BAR");
135 135
136 // Constructors shouldn't interfere with each other 136 // Constructors shouldn't interfere with each other
137 expect((new Foo()).tagName, "X-FOO"); 137 expect((new Foo()).tagName, "X-FOO");
138 expect((new Bar()).tagName, "X-BAR"); 138 expect((new Bar()).tagName, "X-BAR");
139 expect((new Baz()).tagName, "X-BAZ"); 139 expect((new Baz()).tagName, "X-BAZ");
140 }); 140 });
141 } 141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698