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

Unified Diff: packages/initialize/test/initializer_from_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: packages/initialize/test/initializer_from_test.dart
diff --git a/packages/initialize/test/initializer_from_test.dart b/packages/initialize/test/initializer_from_test.dart
index 30587f552a5a04c3148b3163790e42da0c2f37b6..aa7172b57a0fcf2842a3a1e42bbfe2f9001ae643 100644
--- a/packages/initialize/test/initializer_from_test.dart
+++ b/packages/initialize/test/initializer_from_test.dart
@@ -1,31 +1,39 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+
+// TODO(jakemac): swap this to @TestOn('pub-serve') once
+// https://github.com/dart-lang/test/issues/388 is completed.
+@TestOn('!js')
@initializeTracker
library initialize.test.initializer_from_test;
import 'package:initialize/src/initialize_tracker.dart';
import 'package:initialize/initialize.dart';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/compact_vm_config.dart';
-import 'package:test_package/bar.dart'; // Used for annotations
+import 'package:test/test.dart';
+import 'package:test_package/bar.dart' as bar;
+/// Uses [bar]
main() {
- useCompactVMConfiguration();
+ test('The `from` option', () async {
+ final expectedNames = <LibraryIdentifier>[];
+
+ // First just run on the test packages bar.dart file.
+ await run(from: Uri.parse('package:test_package/bar.dart'));
+ expectedNames.add(
+ const LibraryIdentifier(#test_package.bar, 'test_package', 'bar.dart'));
+ expect(InitializeTracker.seen, expectedNames);
- test('The `from` option', () {
- var expectedNames = [];
- return run(from: Uri.parse('package:test_package/bar.dart')).then((_) {
- // First just run on the test packages bar.dart file.
- expectedNames.add(const LibraryIdentifier(
- #test_package.bar, 'test_package', 'bar.dart'));
- expect(InitializeTracker.seen, expectedNames);
- }).then((_) => run()).then((_) {
- // Now we run on the rest (just this file).
- expectedNames.add(const LibraryIdentifier(
- #initialize.test.initializer_from_test, null,
- 'initializer_from_test.dart'));
- expect(InitializeTracker.seen, expectedNames);
- });
- });
+ // Now we run on the rest (just this file).
+ await run();
+ expect(InitializeTracker.seen.length, 2);
+ // Don't know what the path will be, so have to explicitly check fields
+ // and use an [endsWith] matcher for the path.
+ expect(InitializeTracker.seen[1].name,
+ #initialize.test.initializer_from_test);
+ expect(InitializeTracker.seen[1].package, isNull);
+ expect(
+ InitializeTracker.seen[1].path, endsWith('initializer_from_test.dart'));
+ }, skip: 'Should be skipped only in pub-serve mode, blocked on '
+ 'https://github.com/dart-lang/test/issues/388.');
}
« no previous file with comments | « packages/initialize/test/initializer_cycle_error_test.html ('k') | packages/initialize/test/initializer_from_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698