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

Unified Diff: test/runner/precompiled_paths_test.dart

Issue 2040883003: Add support for passing in precompiled JS. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/runner/configuration/configuration_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/precompiled_paths_test.dart
diff --git a/test/runner/precompiled_paths_test.dart b/test/runner/precompiled_paths_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a60a0c832c5d6b5e3a72a751ac581c459b76e5de
--- /dev/null
+++ b/test/runner/precompiled_paths_test.dart
@@ -0,0 +1,58 @@
+// Copyright (c) 2016, 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.
+
+@TestOn("vm")
+@Tags(const ["chrome"])
+
+import 'dart:io';
+
+import 'package:path/path.dart' as p;
+import 'package:scheduled_test/descriptor.dart' as d;
+import 'package:scheduled_test/scheduled_process.dart';
+import 'package:scheduled_test/scheduled_stream.dart';
+import 'package:scheduled_test/scheduled_test.dart';
+
+import 'package:test/src/util/io.dart';
+
+import '../io.dart';
+
+void main() {
+ useSandbox();
+
+ test("runs a precompiled version of a test rather than recompiling", () {
+ d.file("to_precompile.dart", """
+ import "package:stream_channel/stream_channel.dart";
+
+ import "package:test/src/runner/plugin/remote_platform_helpers.dart";
+ import "package:test/src/runner/browser/post_message_channel.dart";
+ import "package:test/test.dart";
+
+ main(_) async {
+ var channel = serializeSuite(() {
+ return () => test("success", () {});
+ }, hidePrints: false);
+ postMessageChannel().pipe(channel);
+ }
+ """).create();
+
+ d.dir("precompiled", []).create();
+
+ var dart2js = new ScheduledProcess.start(p.join(sdkDir, 'bin', 'dart2js'), [
+ "--package-root=${p.join(p.current, 'packages')}",
+ "to_precompile.dart",
+ "--out=precompiled/test.dart.browser_test.dart.js"
+ ], workingDirectory: sandbox);
+ dart2js.shouldExit(0);
+
+ d.file("test.dart", "invalid dart}").create();
+
+ var test = runTest(
+ ["-p", "chrome", "--precompiled=precompiled/", "test.dart"]);
+ test.stdout.expect(containsInOrder([
+ "+0: success",
+ "+1: All tests passed!"
+ ]));
+ test.shouldExit(0);
+ });
+}
« no previous file with comments | « test/runner/configuration/configuration_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698