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

Unified Diff: pkg/polymer/test/build/all_phases_test.dart

Issue 47933006: Build fixes: adds arguments to the pub-build plugin to configure whether 'js' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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: pkg/polymer/test/build/all_phases_test.dart
diff --git a/pkg/polymer/test/build/all_phases_test.dart b/pkg/polymer/test/build/all_phases_test.dart
index 9a1fccd0112f8a1130750f5317ac1d6de7f57cc3..4b6b759f3bc34b42040212889f4d9aaa284ece3a 100644
--- a/pkg/polymer/test/build/all_phases_test.dart
+++ b/pkg/polymer/test/build/all_phases_test.dart
@@ -33,7 +33,7 @@ void main() {
'a|web/test.html':
'<!DOCTYPE html><html><head>'
'<script type="application/dart" src="a.dart"></script>',
- 'a|web/test.dart': _sampleObservable('A', 'foo'),
+ 'a|web/a.dart': _sampleObservable('A', 'foo'),
}, {
'a|web/test.html':
'<!DOCTYPE html><html><head>'
@@ -45,16 +45,18 @@ void main() {
'a|web/test.html_bootstrap.dart':
'''$MAIN_HEADER
- import 'a.dart' as i0;
+ import 'a.dart_modified.dart' as i0;
void main() {
configureForDeployment([
- 'a.dart',
+ 'a.dart_modified.dart',
]);
- i0.main();
+ i0.polymerMainWrapper();
}
'''.replaceAll('\n ', '\n'),
- 'a|web/test.dart': _sampleObservableOutput('A', 'foo'),
+ 'a|web/a.dart': _sampleObservableOutput('A', 'foo'),
+ 'a|web/a.dart_modified.dart':
+ _sampleObservableOutput('A', 'foo', includeMain: true),
});
testPhases('single inline script', phases, {
@@ -73,16 +75,19 @@ void main() {
'a|web/test.html_bootstrap.dart':
'''$MAIN_HEADER
- import 'test.html.0.dart' as i0;
+ import 'test.html.0.dart_modified.dart' as i0;
void main() {
configureForDeployment([
- 'test.html.0.dart',
+ 'test.html.0.dart_modified.dart',
]);
- i0.main();
+ i0.polymerMainWrapper();
}
'''.replaceAll('\n ', '\n'),
- 'a|web/test.html.0.dart': _sampleObservableOutput("B", "bar"),
+ 'a|web/test.html.0.dart':
+ _sampleObservableOutput("B", "bar"),
+ 'a|web/test.html.0.dart_modified.dart':
+ _sampleObservableOutput("B", "bar", includeMain: true),
});
testPhases('several scripts', phases, {
@@ -114,16 +119,18 @@ void main() {
'a|web/test.html_bootstrap.dart':
'''$MAIN_HEADER
- import 'a.dart' as i0;
+ import 'a.dart_modified.dart' as i0;
void main() {
configureForDeployment([
- 'a.dart',
+ 'a.dart_modified.dart',
]);
- i0.main();
+ i0.polymerMainWrapper();
}
'''.replaceAll('\n ', '\n'),
'a|web/a.dart': _sampleObservableOutput('A', 'foo'),
+ 'a|web/a.dart_modified.dart':
+ _sampleObservableOutput('A', 'foo', includeMain: true),
'a|web/test.html.0.dart': _sampleObservableOutput("B", "bar"),
'a|web/test.html.1.dart': _sampleObservableOutput("C", "car"),
});
@@ -153,17 +160,19 @@ void main() {
'a|web/index.html_bootstrap.dart':
'''$MAIN_HEADER
import 'test2.html.0.dart' as i0;
- import 'b.dart' as i1;
+ import 'b.dart_modified.dart' as i1;
void main() {
configureForDeployment([
'test2.html.0.dart',
- 'b.dart',
+ 'b.dart_modified.dart',
]);
- i1.main();
+ i1.polymerMainWrapper();
}
'''.replaceAll('\n ', '\n'),
'a|web/test2.html.0.dart': _sampleObservableOutput("A", "foo"),
+ 'a|web/test2.html.0.dart_modified.dart':
+ _sampleObservableOutput("A", "foo", includeMain: true),
'a|web/b.dart': _sampleObservableOutput('B', 'bar'),
});
}
@@ -178,7 +187,8 @@ class $className extends Observable {
}
''';
-String _sampleObservableOutput(String className, String field) =>
+String _sampleObservableOutput(String className, String field,
+ {bool includeMain: false}) =>
"library ${className}_$field;\n"
"import 'package:observe/observe.dart';\n\n"
"class $className extends ChangeNotifier {\n"
@@ -188,4 +198,5 @@ String _sampleObservableOutput(String className, String field) =>
"__\$$field = notifyPropertyChange(#$field, __\$$field, value); "
"}\n"
" $className($field) : __\$$field = $field;\n"
- "}\n";
+ "}\n"
+ "${includeMain ? '\n\npolymerMainWrapper() => main();\n' : ''}";

Powered by Google App Engine
This is Rietveld 408576698