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

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: code review updates 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
« no previous file with comments | « pkg/polymer/lib/src/mirror_loader.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..578e2090e947ba8d9968e5f0caa8cd9785ebaef6 100644
--- a/pkg/polymer/test/build/import_inliner_test.dart
+++ b/pkg/polymer/test/build/import_inliner_test.dart
@@ -169,6 +169,28 @@ void importTests() {
'a|web/second.js': '/*second*/'
});
+ testLogOutput(
+ (options) => new ImportInliner(options),
+ 'removes duplicate scripts', {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="import" href="packages/a/x_a.html">'
+ '<link rel="import" href="packages/a/x_b.html">'
+ '</head></html>',
+ 'a|lib/x_a.html':
+ '<script type="application/dart" src="bar.dart"></script>',
+ 'a|lib/x_b.html':
+ '<script type="application/dart" src="bar.dart"></script>',
+ 'a|lib/bar.dart': 'var i = 0;'
+ }, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body></body></html>',
+ 'a|web/test.html._data': expectedData(['lib/bar.dart']),
+ }, [
+ 'warning: ${SCRIPT_INCLUDED_MORE_THAN_ONCE.create(
+ {'url': 'packages/a/bar.dart'}).snippet} (lib/x_b.html 0 0)'
+ ]);
+
final cspPhases = [[new ImportInliner(
new TransformOptions(contentSecurityPolicy: true))]];
testPhases('extract Js scripts in CSP mode', cspPhases,
« no previous file with comments | « 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