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

Side by Side Diff: pkg/web_components/test/interop_test.dart

Issue 325893003: Fix, take 3 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « pkg/web_components/test/interop2_test.dart ('k') | no next file » | 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 template_wrappers_test; 5 library template_wrappers_test;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:js' show context, JsObject; 9 import 'dart:js' show context, JsObject;
10 import 'package:unittest/html_config.dart'; 10 import 'package:unittest/html_config.dart';
11 import 'package:unittest/unittest.dart'; 11 import 'package:unittest/unittest.dart';
12 import 'package:web_components/interop.dart'; 12 import 'package:web_components/interop.dart';
13 import 'package:web_components/polyfill.dart'; 13 import 'package:web_components/polyfill.dart';
14 14
15 main() { 15 final globalSetup = customElementsReady.then((_) {
16 useHtmlConfiguration();
17 setUp(() => customElementsReady.then((_) {
18 registerDartType('x-a', XAWrapper); 16 registerDartType('x-a', XAWrapper);
19 registerDartType('x-b', XBWrapper, extendsTag: 'div'); 17 registerDartType('x-b', XBWrapper, extendsTag: 'div');
20 registerDartType('x-c', XCWrapper); 18 registerDartType('x-c', XCWrapper);
21 })); 19 });
20
21 main() {
22 useHtmlConfiguration();
23 setUp(() => globalSetup);
22 24
23 test('interop is supported', () { 25 test('interop is supported', () {
24 expect(isSupported, isTrue); 26 expect(isSupported, isTrue);
25 }); 27 });
26 28
27 test('previously created elements are not upgraded', () { 29 test('previously created elements are not upgraded', () {
28 var a = document.querySelector('x-a'); 30 var a = document.querySelector('x-a');
29 expect(a is HtmlElement, isTrue, reason: 'x-a is HtmlElement'); 31 expect(a is HtmlElement, isTrue, reason: 'x-a is HtmlElement');
30 expect(a is XAWrapper, isFalse, reason: 'x-a should not be upgraded yet'); 32 expect(a is XAWrapper, isFalse, reason: 'x-a should not be upgraded yet');
31 expect(_readX(a), 0); 33 expect(_readX(a), 0);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 XAWrapper.created() : super.created(); 98 XAWrapper.created() : super.created();
97 } 99 }
98 100
99 class XBWrapper extends DivElement with Wrapper { 101 class XBWrapper extends DivElement with Wrapper {
100 XBWrapper.created() : super.created(); 102 XBWrapper.created() : super.created();
101 } 103 }
102 104
103 class XCWrapper extends HtmlElement with Wrapper { 105 class XCWrapper extends HtmlElement with Wrapper {
104 XCWrapper.created() : super.created(); 106 XCWrapper.created() : super.created();
105 } 107 }
OLDNEW
« no previous file with comments | « pkg/web_components/test/interop2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698