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

Unified Diff: lib/src/runner/browser/server.dart

Issue 1152083008: Add special-case support for Polymer tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 7 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 | « lib/src/runner/browser/polymer.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/server.dart
diff --git a/lib/src/runner/browser/server.dart b/lib/src/runner/browser/server.dart
index 716da34b9ccd2dedd404f45ae82ac0328a017aea..e4b9d853c625d6b1061107fe6dec110654e04388 100644
--- a/lib/src/runner/browser/server.dart
+++ b/lib/src/runner/browser/server.dart
@@ -36,6 +36,7 @@ import 'dartium.dart';
import 'firefox.dart';
import 'internet_explorer.dart';
import 'phantom_js.dart';
+import 'polymer.dart';
import 'safari.dart';
/// A server that serves JS-compiled tests to browsers.
@@ -263,8 +264,21 @@ void main() {
if (_pubServeUrl != null) {
var suitePrefix = p.withoutExtension(
p.relative(path, from: p.join(_root, 'test')));
- var jsUrl = _pubServeUrl.resolve(
+
+ var jsUrl;
+ // Polymer generates a bootstrap entrypoint that wraps the entrypoint we
+ // see on disk, and modifies the HTML file to point to the bootstrap
+ // instead. To make sure we get the right source maps and wait for the
+ // right file to compile, we have some Polymer-specific logic here to load
+ // the boostrap instead of the unwrapped file.
+ if (isPolymerEntrypoint(path)) {
+ jsUrl = _pubServeUrl.resolve(
+ "$suitePrefix.html.polymer.bootstrap.dart.browser_test.dart.js");
+ } else {
+ jsUrl = _pubServeUrl.resolve(
'$suitePrefix.dart.browser_test.dart.js');
+ }
+
await _pubServeSuite(path, jsUrl);
suiteUrl = _pubServeUrl.resolveUri(p.toUri('$suitePrefix.html'));
} else {
« no previous file with comments | « lib/src/runner/browser/polymer.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698