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

Side by Side Diff: tests/html/custom_elements_test.dart

Issue 22918010: Removing custom element preload test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | tests/html/html.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 custom_elements_test; 5 library custom_elements_test;
6 import '../../pkg/unittest/lib/unittest.dart'; 6 import '../../pkg/unittest/lib/unittest.dart';
7 import '../../pkg/unittest/lib/html_individual_config.dart'; 7 import '../../pkg/unittest/lib/html_individual_config.dart';
8 import 'dart:html'; 8 import 'dart:html';
9 9
10 class CustomMixin { 10 class CustomMixin {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 }, throws, reason: 'Cannot register a native element.'); 76 }, throws, reason: 'Cannot register a native element.');
77 }); 77 });
78 78
79 test('register non-element', () { 79 test('register non-element', () {
80 expect(() { 80 expect(() {
81 document.register(nextTag, NotAnElement); 81 document.register(nextTag, NotAnElement);
82 }, throws, reason: 'Cannot register a non-element.'); 82 }, throws, reason: 'Cannot register a non-element.');
83 }); 83 });
84 }); 84 });
85 85
86 // TODO(vsm): Modify this test once we agree on the proper semantics.
87 /*
86 group('preregister', () { 88 group('preregister', () {
87 // TODO(vsm): Modify this test once we agree on the proper semantics. 89
88 test('pre-registration construction', () { 90 test('pre-registration construction', () {
89 var tag = nextTag; 91 var tag = nextTag;
90 var dom = new Element.html('<div><$tag></$tag></div>'); 92 var dom = new Element.html('<div><$tag></$tag></div>');
91 var preElement = dom.children[0]; 93 var preElement = dom.children[0];
92 expect(preElement, isNotNull); 94 expect(preElement, isNotNull);
93 expect(preElement is HtmlElement, isTrue); 95 expect(preElement is HtmlElement, isTrue);
94 expect(preElement is CustomType, isFalse); 96 expect(preElement is CustomType, isFalse);
95 var firedOnPre = false; 97 var firedOnPre = false;
96 preElement.onFocus.listen((_) { 98 preElement.onFocus.listen((_) {
97 firedOnPre = true; 99 firedOnPre = true;
(...skipping 13 matching lines...) Expand all
111 113
112 var firedOnPost = false; 114 var firedOnPost = false;
113 postElement.onFocus.listen((_) { 115 postElement.onFocus.listen((_) {
114 firedOnPost = true; 116 firedOnPost = true;
115 }); 117 });
116 // Event handlers persist on old and new element. 118 // Event handlers persist on old and new element.
117 postElement.dispatchEvent(new Event('focus')); 119 postElement.dispatchEvent(new Event('focus'));
118 expect(firedOnPre, isTrue); 120 expect(firedOnPre, isTrue);
119 expect(firedOnPost, isTrue); 121 expect(firedOnPost, isTrue);
120 }); 122 });
121 }); 123 });*/
122 124
123 group('innerHtml', () { 125 group('innerHtml', () {
124 test('query', () { 126 test('query', () {
125 var tag = nextTag; 127 var tag = nextTag;
126 document.register(tag, CustomType); 128 document.register(tag, CustomType);
127 var element = new DivElement(); 129 var element = new DivElement();
128 element.innerHtml = '<$tag></$tag>'; 130 element.innerHtml = '<$tag></$tag>';
129 document.body.nodes.add(element); 131 document.body.nodes.add(element);
130 var queried = query(tag); 132 var queried = query(tag);
131 133
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 test('can invoke mixin methods', () { 166 test('can invoke mixin methods', () {
165 var tag = nextTag; 167 var tag = nextTag;
166 document.register(tag, CustomType); 168 document.register(tag, CustomType);
167 169
168 var element = new Element.tag(tag); 170 var element = new Element.tag(tag);
169 element.invokeMixinMethod(); 171 element.invokeMixinMethod();
170 expect(element.mixinMethodCalled, isTrue); 172 expect(element.mixinMethodCalled, isTrue);
171 }); 173 });
172 }); 174 });
173 } 175 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698