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

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

Issue 172853004: [polymer] preserve order of scripts in deployment (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: revert pkg/polymer/test/build/static_clean_test.dart Created 6 years, 10 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/import_inliner_test.dart
diff --git a/pkg/polymer/test/build/import_inliner_test.dart b/pkg/polymer/test/build/import_inliner_test.dart
index a65d2646eacf6e0bf800e8ece4f04d8fb3d8ce4c..f66500322399d80d2c44aae3bd54073ddfb3e28e 100644
--- a/pkg/polymer/test/build/import_inliner_test.dart
+++ b/pkg/polymer/test/build/import_inliner_test.dart
@@ -88,6 +88,37 @@ void importTests() {
'a|web/test2.html.scriptUrls': '[]',
});
+ testPhases('preserves order of scripts', phases,
+ {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>'
+ '<script type="text/javascript">/*first*/</script>'
+ '<script src="second.js"></script>'
+ '<link rel="import" href="test2.html">'
+ '<script type="application/dart">/*forth*/</script>'
+ '</head></html>',
+ 'a|web/test2.html':
+ '<!DOCTYPE html><html><head><script>/*third*/</script>'
+ '</head><body><polymer-element>2</polymer-element></html>',
+ 'a|web/second.js': '/*second*/'
+ }, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>'
+ '</head><body>'
+ '<script type="text/javascript">/*first*/</script>'
+ '<script src="second.js"></script>'
+ '<script>/*third*/</script>'
Siggi Cherem (dart-lang) 2014/02/20 03:50:55 I assume this would have been below /*forth*/ if y
Jennifer Messerly 2014/02/20 03:56:07 yeah. Without the change 1, 2 and 4 would be left
+ '<polymer-element>2</polymer-element>'
+ '<script type="application/dart">/*forth*/</script>'
+ '</body></html>',
+ 'a|web/test.html.scriptUrls': '[]',
+ 'a|web/test2.html':
+ '<!DOCTYPE html><html><head><script>/*third*/</script>'
+ '</head><body><polymer-element>2</polymer-element></html>',
+ 'a|web/test2.html.scriptUrls': '[]',
+ 'a|web/second.js': '/*second*/'
+ });
+
testPhases('no transformation outside web/', phases,
{
'a|lib/test.html':
@@ -564,9 +595,9 @@ void stylesheetTests() {
'h1 { font-size: 70px; }',
}, {
'a|web/test.html':
- '<!DOCTYPE html><html><head>'
+ '<!DOCTYPE html><html><head></head><body>'
'<style>h1 { font-size: 70px; }</style>'
- '</head><body></body></html>',
+ '</body></html>',
'a|web/test.html.scriptUrls': '[]',
'a|web/test2.css':
'h1 { font-size: 70px; }',
@@ -611,4 +642,27 @@ void stylesheetTests() {
'b|asset/test4.png': 'PNG',
'c|lib/test5.png': 'PNG',
});
+
+
+ testPhases('shallow, inlines css and preserves order', phases, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>'
+ '<style>.first { color: black }</style>'
+ '<link rel="stylesheet" href="test2.css">'
+ '<style>.second { color: black }</style>'
+ '</head></html>',
+ 'a|web/test2.css':
+ 'h1 { font-size: 70px; }',
+ }, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<style>.first { color: black }</style>'
+ '<style>h1 { font-size: 70px; }</style>'
+ '<style>.second { color: black }</style>'
+ '</body></html>',
+ 'a|web/test.html.scriptUrls': '[]',
+ 'a|web/test2.css':
+ 'h1 { font-size: 70px; }',
+ });
+
}

Powered by Google App Engine
This is Rietveld 408576698