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

Side by Side Diff: pkg/polymer/test/register_test.dart

Issue 293023008: Bring back initPolymer, allow boot.js only if using "polymer_experimental.html". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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) 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 import 'dart:html'; 5 import 'dart:html';
6 import 'package:polymer/polymer.dart'; 6 import 'package:polymer/polymer.dart';
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'package:unittest/html_config.dart'; 8 import 'package:unittest/html_config.dart';
9 9
10 @CustomTag('x-html') 10 @CustomTag('x-html')
(...skipping 22 matching lines...) Expand all
33 XPolymerElement.created() : super.created(); 33 XPolymerElement.created() : super.created();
34 } 34 }
35 35
36 /// Dart-specific test: 36 /// Dart-specific test:
37 /// This element is registered from code without an associated polymer-element. 37 /// This element is registered from code without an associated polymer-element.
38 class XButtonElement extends ButtonElement with Polymer, Observable { 38 class XButtonElement extends ButtonElement with Polymer, Observable {
39 XButtonElement.created() : super.created(); 39 XButtonElement.created() : super.created();
40 } 40 }
41 41
42 42
43 @initMethod
44 main() { 43 main() {
44 initPolymer();
45 useHtmlConfiguration(); 45 useHtmlConfiguration();
46 46
47 setUp(() => Polymer.onReady); 47 setUp(() => Polymer.onReady);
48 48
49 test('elements upgraded', () { 49 test('elements upgraded', () {
50 expect(querySelector('x-html') is XHtmlElement, isTrue); 50 expect(querySelector('x-html') is XHtmlElement, isTrue);
51 expect(querySelector('x-html-two') is XHtml2Element, isTrue); 51 expect(querySelector('x-html-two') is XHtml2Element, isTrue);
52 expect(querySelector('#x-div') is XDivElement, isTrue); 52 expect(querySelector('#x-div') is XDivElement, isTrue);
53 expect(querySelector('#x-div-two') is XDiv2Element, isTrue); 53 expect(querySelector('#x-div-two') is XDiv2Element, isTrue);
54 }); 54 });
(...skipping 17 matching lines...) Expand all
72 test('type extension', () { 72 test('type extension', () {
73 Polymer.registerSync('x-button', XButtonElement, extendsTag: 'button'); 73 Polymer.registerSync('x-button', XButtonElement, extendsTag: 'button');
74 74
75 expect(document.createElement('button', 'x-button') is XButtonElement, 75 expect(document.createElement('button', 'x-button') is XButtonElement,
76 isTrue, reason: 'should have been registered'); 76 isTrue, reason: 'should have been registered');
77 expect(document.querySelector('[is=x-button]') is XButtonElement, isTrue, 77 expect(document.querySelector('[is=x-button]') is XButtonElement, isTrue,
78 reason: 'elements on page should be upgraded'); 78 reason: 'elements on page should be upgraded');
79 }); 79 });
80 }); 80 });
81 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698