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

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

Issue 27903006: Improves how to initialize polymer apps and fixes polymer build and linter to (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 047dca42c78f5f6f0ae005df0446770d815a744d..1af297dbe5892028c5a1a95f3ea9cbcf6a61b5d5 100644
--- a/pkg/polymer/test/build/all_phases_test.dart
+++ b/pkg/polymer/test/build/all_phases_test.dart
@@ -35,13 +35,13 @@ void main() {
'a|web/test.dart': _sampleObservable('A', 'foo'),
}, {
'a|web/test.html':
- '<!DOCTYPE html><html><head></head><body>'
+ '<!DOCTYPE html><html><head>'
'$SHADOW_DOM_TAG'
'$CUSTOM_ELEMENT_TAG'
'$INTEROP_TAG'
'<script type="application/dart" '
'src="test.html_bootstrap.dart"></script>'
- '<script src="packages/browser/dart.js"></script>'
+ '</head><body><script src="packages/browser/dart.js"></script>'
'</body></html>',
'a|web/test.html_bootstrap.dart':
@@ -49,9 +49,10 @@ void main() {
import 'a.dart' as i0;
void main() {
- initPolymer([
+ librariesToLoad = [
'a.dart',
- ]);
+ ];
+ i0.main();
}
'''.replaceAll('\n ', '\n'),
'a|web/test.dart': _sampleObservableOutput('A', 'foo'),
@@ -64,13 +65,13 @@ void main() {
'${_sampleObservable("B", "bar")}</script>',
}, {
'a|web/test.html':
- '<!DOCTYPE html><html><head></head><body>'
+ '<!DOCTYPE html><html><head>'
'$SHADOW_DOM_TAG'
'$CUSTOM_ELEMENT_TAG'
'$INTEROP_TAG'
'<script type="application/dart" '
'src="test.html_bootstrap.dart"></script>'
- '<script src="packages/browser/dart.js"></script>'
+ '</head><body><script src="packages/browser/dart.js"></script>'
'</body></html>',
'a|web/test.html_bootstrap.dart':
@@ -78,9 +79,10 @@ void main() {
import 'test.html.0.dart' as i0;
void main() {
- initPolymer([
+ librariesToLoad = [
'test.html.0.dart',
- ]);
+ ];
+ i0.main();
}
'''.replaceAll('\n ', '\n'),
'a|web/test.html.0.dart': _sampleObservableOutput("B", "bar"),
@@ -90,6 +92,10 @@ void main() {
'a|web/test.html':
'<!DOCTYPE html><html><head>'
'<script type="application/dart" src="a.dart"></script>'
+ // TODO(sigmund): provide a way to see logging warnings and errors.
+ // For example, these extra tags produce warnings and are then removed
+ // by the transformers. The test below checks that the output looks
+ // correct, but we should also validate the messages logged.
'<script type="application/dart">'
'${_sampleObservable("B", "bar")}</script>'
'</head><body><div>'
@@ -100,30 +106,26 @@ void main() {
'a|web/a.dart': _sampleObservable('A', 'foo'),
}, {
'a|web/test.html':
- '<!DOCTYPE html><html><head></head><body>'
+ '<!DOCTYPE html><html><head>'
'$SHADOW_DOM_TAG'
'$CUSTOM_ELEMENT_TAG'
'$INTEROP_TAG'
- '<div></div>'
'<script type="application/dart" '
'src="test.html_bootstrap.dart"></script>'
+ '</head><body>'
+ '<div></div>'
'<script src="packages/browser/dart.js"></script>'
'</body></html>',
'a|web/test.html_bootstrap.dart':
'''$MAIN_HEADER
import 'a.dart' as i0;
- import 'test.html.0.dart' as i1;
- import 'test.html.1.dart' as i2;
- import 'd.dart' as i3;
void main() {
- initPolymer([
+ librariesToLoad = [
'a.dart',
- 'test.html.0.dart',
- 'test.html.1.dart',
- 'd.dart',
- ]);
+ ];
+ i0.main();
}
'''.replaceAll('\n ', '\n'),
'a|web/a.dart': _sampleObservableOutput('A', 'foo'),
@@ -136,9 +138,7 @@ void main() {
'<!DOCTYPE html><html><head>'
'<link rel="import" href="test2.html">'
'</head><body>'
- '<script type="application/dart" src="b.dart"></script>'
- '<script type="application/dart">'
- '${_sampleObservable("C", "car")}</script>',
+ '<script type="application/dart" src="b.dart"></script>',
'a|web/b.dart': _sampleObservable('B', 'bar'),
'a|web/test2.html':
'<!DOCTYPE html><html><head></head><body>'
@@ -148,11 +148,11 @@ void main() {
'</polymer-element></html>',
}, {
'a|web/index.html':
- '<!DOCTYPE html><html><head></head><body>'
+ '<!DOCTYPE html><html><head>'
'$SHADOW_DOM_TAG'
'$CUSTOM_ELEMENT_TAG'
'$INTEROP_TAG'
- '<polymer-element>1</polymer-element>'
+ '</head><body><polymer-element>1</polymer-element>'
'<script type="application/dart" '
'src="index.html_bootstrap.dart"></script>'
'<script src="packages/browser/dart.js"></script>'
@@ -161,19 +161,17 @@ void main() {
'''$MAIN_HEADER
import 'test2.html.0.dart' as i0;
import 'b.dart' as i1;
- import 'index.html.0.dart' as i2;
void main() {
- initPolymer([
+ librariesToLoad = [
'test2.html.0.dart',
'b.dart',
- 'index.html.0.dart',
- ]);
+ ];
+ i1.main();
}
'''.replaceAll('\n ', '\n'),
'a|web/test2.html.0.dart': _sampleObservableOutput("A", "foo"),
'a|web/b.dart': _sampleObservableOutput('B', 'bar'),
- 'a|web/index.html.0.dart': _sampleObservableOutput("C", "car"),
});
}

Powered by Google App Engine
This is Rietveld 408576698