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

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

Issue 268313002: [dart:html] rename register to registerElement per spec (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 register_element_proxy_test; 5 library register_element_proxy_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:js' as js; 9 import 'dart:js' as js;
10 import 'package:unittest/html_config.dart'; 10 import 'package:unittest/html_config.dart';
(...skipping 22 matching lines...) Expand all
33 var registered = false; 33 var registered = false;
34 var upgrader; 34 var upgrader;
35 setUp(() => customElementsReady.then((_) { 35 setUp(() => customElementsReady.then((_) {
36 if (!registered) { 36 if (!registered) {
37 registered = true; 37 registered = true;
38 upgrader = document.createElementUpgrader(FooElement); 38 upgrader = document.createElementUpgrader(FooElement);
39 js.context['upgradeListener'] = (e) { 39 js.context['upgradeListener'] = (e) {
40 upgrader.upgrade(e); 40 upgrader.upgrade(e);
41 }; 41 };
42 42
43 document.register('custom-element', CustomElement); 43 document.registerElement('custom-element', CustomElement);
44 } 44 }
45 })); 45 }));
46 46
47 test('created gets proxied', () { 47 test('created gets proxied', () {
48 var element = document.createElement(FooElement.tag); 48 var element = document.createElement(FooElement.tag);
49 expect(element is FooElement, isTrue); 49 expect(element is FooElement, isTrue);
50 expect(element.initializedField, 666); 50 expect(element.initializedField, 666);
51 expect(element.text, 'constructed'); 51 expect(element.text, 'constructed');
52 52
53 js.context.callMethod('validateIsFoo', [element]); 53 js.context.callMethod('validateIsFoo', [element]);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 124
125 class CustomDiv extends DivElement { 125 class CustomDiv extends DivElement {
126 CustomDiv.created() : super.created(); 126 CustomDiv.created() : super.created();
127 } 127 }
128 128
129 class CustomElement extends HtmlElement { 129 class CustomElement extends HtmlElement {
130 factory CustomElement() => document.createElement('custom-element'); 130 factory CustomElement() => document.createElement('custom-element');
131 CustomElement.created() : super.created(); 131 CustomElement.created() : super.created();
132 } 132 }
OLDNEW
« no previous file with comments | « tests/html/custom/document_register_type_extensions_test.dart ('k') | tests/html/custom/entered_left_view_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698