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

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

Issue 794473002: Delete polymer from the Dart repo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/polymer/test/mirror_loader_4.dart ('k') | pkg/polymer/test/nested_binding_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6
7 import 'dart:mirrors';
8
9 import 'package:unittest/unittest.dart';
10 import 'package:unittest/html_config.dart';
11
12 import 'package:polymer/src/mirror_loader.dart';
13 /// prevent unused import warnings: [m1.XA] [m2.XA] [m3.XB] [m4.XA].
14 import 'mirror_loader_1.dart' as m1;
15 import 'mirror_loader_2.dart' as m2;
16 import 'mirror_loader_3.dart' as m3;
17 import 'mirror_loader_4.dart' as m4;
18
19 main() {
20 useHtmlConfiguration();
21
22 test('registered correctly', () {
23 expect(_discover(#mirror_loader_test1).length, 1);
24 expect(_discover(#mirror_loader_test2).length, 1);
25 });
26
27 test('parameterized custom tags are not registered', () {
28 runZoned(() {
29 expect(_discover(#mirror_loader_test3).length, 0);
30 }, onError: (e) {
31 expect(e is UnsupportedError, isTrue);
32 expect('$e', contains(
33 'Custom element classes cannot have type-parameters: XB'));
34 });
35 });
36
37 test('registers correct types even when errors are found', () {
38 runZoned(() {
39 expect(_discover(#mirror_loader_test4).length, 1);
40 }, onError: (e) {
41 expect(e is UnsupportedError, isTrue);
42 expect('$e', contains(
43 'Custom element classes cannot have type-parameters: XB'));
44 });
45 });
46 }
47
48 final mirrors = currentMirrorSystem();
49 _discover(Symbol name) =>
50 discoverInitializers([mirrors.findLibrary(name).uri.toString()]);
OLDNEW
« no previous file with comments | « pkg/polymer/test/mirror_loader_4.dart ('k') | pkg/polymer/test/nested_binding_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698