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

Unified Diff: lib/src/runner/browser/platform.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 | « no previous file | lib/src/runner/configuration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/platform.dart
diff --git a/lib/src/runner/browser/platform.dart b/lib/src/runner/browser/platform.dart
index 2884a530cb9c4d48b5cf2d0c4fc1b32cf90efb93..14d799fd19e3c80ce266e2adec8c7d848e6746cf 100644
--- a/lib/src/runner/browser/platform.dart
+++ b/lib/src/runner/browser/platform.dart
@@ -124,6 +124,10 @@ class BrowserPlatform extends PlatformPlugin {
.add(_jsHandler.handler)
.add(createStaticHandler(_root))
.add(_wrapperHandler);
+
+ if (config.precompiledPath != null) {
+ cascade = cascade.add(createStaticHandler(config.precompiledPath));
+ }
}
var pipeline = new shelf.Pipeline()
@@ -242,7 +246,7 @@ class BrowserPlatform extends PlatformPlugin {
await _pubServeSuite(path, dartUrl, browser);
suiteUrl = _config.pubServeUrl.resolveUri(p.toUri('$suitePrefix.html'));
} else {
- if (browser.isJS) await _compileSuite(path);
+ if (browser.isJS && !_precompiled(path)) await _compileSuite(path);
if (_closed) return null;
suiteUrl = url.resolveUri(p.toUri(
p.withoutExtension(p.relative(path, from: _root)) + ".html"));
@@ -260,6 +264,17 @@ class BrowserPlatform extends PlatformPlugin {
return suite;
}
+ /// Returns whether the test at [path] has precompiled JS available underneath
+ /// `_config.precompiledPath`.
+ bool _precompiled(String path) {
+ if (_config.precompiledPath == null) return false;
+ var jsPath =
+ p.join(_config.precompiledPath, p.relative(path, from: _root)) +
+ ".browser_test.dart.js";
+ print("does $jsPath exist? ${new File(jsPath).existsSync()}");
+ return new File(jsPath).existsSync();
+ }
+
StreamChannel loadChannel(String path, TestPlatform platform) =>
throw new UnimplementedError();
« no previous file with comments | « no previous file | lib/src/runner/configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698