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

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

Issue 662013004: fix duplicate script issue (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add warnings and fix dynamic version Created 6 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/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 a891a123a35aaffaef22d23cc618263aca298fad..63d9528bea324d46f45a152c1bf3a6212cf0eb83 100644
--- a/pkg/polymer/test/build/import_inliner_test.dart
+++ b/pkg/polymer/test/build/import_inliner_test.dart
@@ -169,6 +169,31 @@ void importTests() {
'a|web/second.js': '/*second*/'
});
+ testLogOutput(
+ (options) => new ImportInliner(options),
+ 'removes duplicate scripts',
+ {
Siggi Cherem (dart-lang) 2014/10/21 17:06:03 nit: move this char to the prev line? (consistency
jakemac 2014/10/21 18:14:01 Done.
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="import" href="x_a.html">'
+ '<link rel="import" href="x_b.html">'
+ '</head></html>',
+ 'a|web/x_a.html':
+ '<!DOCTYPE html>'
+ '<script type="application/dart" src="foo.dart"></script>',
Siggi Cherem (dart-lang) 2014/10/21 17:06:03 minor silly thing - because the example you have i
jakemac 2014/10/21 18:14:01 Done.
+ 'a|web/x_b.html':
+ '<!DOCTYPE html>'
+ '<script type="application/dart" src="foo.dart"></script>',
+ 'a|web/foo.dart': 'var i = 0;'
+ }, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body></body></html>',
+ 'a|web/test.html._data': expectedData(['web/foo.dart']),
+ }, [
+ 'warning: ${SCRIPT_INCLUDED_MORE_THAN_ONCE.create({'url': 'foo.dart'})
+ .snippet} (web/x_b.html 0 15)'
+ ]);
+
final cspPhases = [[new ImportInliner(
new TransformOptions(contentSecurityPolicy: true))]];
testPhases('extract Js scripts in CSP mode', cspPhases,
« pkg/polymer/lib/src/mirror_loader.dart ('K') | « pkg/polymer/lib/src/mirror_loader.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698