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

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

Issue 158083002: introduce web_components pkg for consolidated polyfills (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « tests/html/custom/js_custom_test.html ('k') | tests/html/custom/mirrors_test.html » ('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 tests.html.mirrors_test; 5 library tests.html.mirrors_test;
6 6
7 @MirrorsUsed(targets: const [A, B]) 7 @MirrorsUsed(targets: const [A, B])
8 import 'dart:mirrors'; 8 import 'dart:mirrors';
9 import 'dart:html'; 9 import 'dart:html';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
11 import 'package:unittest/html_config.dart'; 11 import 'package:unittest/html_config.dart';
12 import '../utils.dart'; 12 import '../utils.dart';
13 13
14 /// Regression test for a tricky mirrors+custom_elements issue: 14 /// Regression test for a tricky mirrors+custom_elements issue:
15 /// dart2js mirrors cache dispatch information on the Object's constructor. 15 /// dart2js mirrors cache dispatch information on the Object's constructor.
16 /// This was failing for custom elements on IE 10, because the constructor was 16 /// This was failing for custom elements on IE 10, because the constructor was
17 /// HTMLUnknownElement for all of them. So mirrors called the wrong method. 17 /// HTMLUnknownElement for all of them. So mirrors called the wrong method.
18 main() { 18 main() {
19 useHtmlConfiguration(); 19 useHtmlConfiguration();
20 20
21 var registered = false; 21 var registered = false;
22 setUp(() => loadPolyfills().then((_) { 22 setUp(() => customElementsReady.then((_) {
23 if (!registered) { 23 if (!registered) {
24 registered = true; 24 registered = true;
25 document.register(A.tag, A); 25 document.register(A.tag, A);
26 document.register(B.tag, B); 26 document.register(B.tag, B);
27 } 27 }
28 })); 28 }));
29 29
30 test('dynamic dispatch', () { 30 test('dynamic dispatch', () {
31 var a = new A(); 31 var a = new A();
32 expect(a.fooBar, 1); 32 expect(a.fooBar, 1);
(...skipping 25 matching lines...) Expand all
58 58
59 int _fooBar = 2; 59 int _fooBar = 2;
60 int _fooBarSet = 0; 60 int _fooBarSet = 0;
61 61
62 int get fooBar => _fooBar; 62 int get fooBar => _fooBar;
63 set fooBar(value) { 63 set fooBar(value) {
64 _fooBarSet++; 64 _fooBarSet++;
65 _fooBar = value; 65 _fooBar = value;
66 } 66 }
67 } 67 }
OLDNEW
« no previous file with comments | « tests/html/custom/js_custom_test.html ('k') | tests/html/custom/mirrors_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698