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

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

Issue 589743002: warn if inlining the same css file more than once (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: generate messages.html, update pubspec/changelog for release Created 6 years, 3 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/pubspec.yaml ('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 d4e0aa05c55ac4af5d1825066de6f122a444d2d8..a891a123a35aaffaef22d23cc618263aca298fad 100644
--- a/pkg/polymer/test/build/import_inliner_test.dart
+++ b/pkg/polymer/test/build/import_inliner_test.dart
@@ -1028,6 +1028,69 @@ void stylesheetTests() {
'<link rel="stylesheet" href="packages/c/buz.css">'
'</body></html>',
});
+
+ testLogOutput(
+ (options) => new ImportInliner(options),
+ 'warns about multiple inlinings of the same css', {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="stylesheet" href="packages/a/foo.css">'
+ '<link rel="stylesheet" href="packages/a/foo.css">'
+ '</head><body></body></html>',
+ 'a|web/test1.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="stylesheet" href="packages/a/foo.css">'
+ '<link rel="import" href="packages/a/import1.html">'
+ '</head><body></body></html>',
+ 'a|web/test2.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="import" href="packages/a/import1.html">'
+ '<link rel="import" href="packages/a/import2.html">'
+ '</head><body></body></html>',
+ 'a|lib/import1.html':
+ '<link rel="stylesheet" href="foo.css">',
+ 'a|lib/import2.html':
+ '<link rel="stylesheet" href="foo.css">',
+ 'a|lib/foo.css':
+ 'body {position: relative;}',
+ }, {}, [
+ 'warning: ${CSS_FILE_INLINED_MULTIPLE_TIMES.create(
+ {'url': 'lib/foo.css'}).snippet}'
+ ' (web/test.html 0 76)',
+ 'warning: ${CSS_FILE_INLINED_MULTIPLE_TIMES.create(
+ {'url': 'lib/foo.css'}).snippet}'
+ ' (lib/import1.html 0 0)',
+ 'warning: ${CSS_FILE_INLINED_MULTIPLE_TIMES.create(
+ {'url': 'lib/foo.css'}).snippet}'
+ ' (lib/import2.html 0 0)',
+ ]);
+
+ testPhases(
+ 'doesn\'t warn about multiple css inlinings if overriden',
+ [[new ImportInliner(new TransformOptions(
+ inlineStylesheets: {'lib/foo.css': true}))]], {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="stylesheet" href="packages/a/foo.css">'
+ '<link rel="stylesheet" href="packages/a/foo.css">'
+ '</head><body></body></html>',
+ 'a|web/test1.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="stylesheet" href="packages/a/foo.css">'
+ '<link rel="import" href="packages/a/import1.html">'
+ '</head><body></body></html>',
+ 'a|web/test2.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="import" href="packages/a/import1.html">'
+ '<link rel="import" href="packages/a/import2.html">'
+ '</head><body></body></html>',
+ 'a|lib/import1.html':
+ '<link rel="stylesheet" href="foo.css">',
+ 'a|lib/import2.html':
+ '<link rel="stylesheet" href="foo.css">',
+ 'a|lib/foo.css':
+ 'body {position: relative;}',
+ }, {}, []);
}
void urlAttributeTests() {
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698