| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 @initializeTracker | 4 @initializeTracker |
| 5 @TestOn('browser') |
| 5 library web_components.test.init_web_components_test; | 6 library web_components.test.init_web_components_test; |
| 6 | 7 |
| 7 import 'package:unittest/html_config.dart'; | 8 import 'package:test/test.dart'; |
| 8 import 'package:unittest/unittest.dart'; | |
| 9 import 'package:initialize/initialize.dart' show LibraryIdentifier; | 9 import 'package:initialize/initialize.dart' show LibraryIdentifier; |
| 10 import 'package:initialize/src/initialize_tracker.dart'; | 10 import 'package:initialize/src/initialize_tracker.dart'; |
| 11 import 'package:web_components/web_components.dart'; | 11 import 'package:web_components/web_components.dart'; |
| 12 | 12 |
| 13 const String importPath = 'my_import.html'; | 13 const String importPath = 'my_import.html'; |
| 14 | 14 |
| 15 main() { | 15 main() { |
| 16 useHtmlConfiguration(); | |
| 17 | |
| 18 test('can initialize scripts from html imports', () { | 16 test('can initialize scripts from html imports', () { |
| 19 return initWebComponents().then((_) { | 17 return initWebComponents().then((_) { |
| 20 var expectedInitializers = [ | 18 var expectedInitializers = [ |
| 21 const LibraryIdentifier( | 19 const LibraryIdentifier( |
| 22 #web_components.test.deps.b, null, 'deps/b.dart'), | 20 #web_components.test.deps.b, null, 'deps/b.dart'), |
| 23 // This one changes based on deploy mode because its an inline script. | 21 // This one changes based on deploy mode because its an inline script. |
| 24 const LibraryIdentifier(#web_components.test.deps.c, null, deployMode | 22 const LibraryIdentifier( |
| 25 ? 'init_web_components_test.html.0.dart' | 23 #web_components.test.deps.c, |
| 26 : 'deps/c.html'), | 24 null, |
| 25 deployMode |
| 26 ? 'init_web_components_test.html.0.dart' |
| 27 : 'deps/c.html'), |
| 27 const LibraryIdentifier( | 28 const LibraryIdentifier( |
| 28 #web_components.test.deps.a, null, 'deps/a.dart'), | 29 #web_components.test.deps.a, null, 'deps/a.dart'), |
| 29 const LibraryIdentifier(#web_components.test.init_web_components_test, | 30 const LibraryIdentifier(#web_components.test.init_web_components_test, |
| 30 null, 'init_web_components_test.dart'), | 31 null, 'init_web_components_test.dart'), |
| 31 ]; | 32 ]; |
| 32 expect(InitializeTracker.seen, expectedInitializers); | 33 expect(InitializeTracker.seen, expectedInitializers); |
| 33 }); | 34 }); |
| 34 }); | 35 }); |
| 35 } | 36 } |
| OLD | NEW |