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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library polymer.test.build.import_inliner_test; 5 library polymer.test.build.import_inliner_test;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'package:polymer/src/build/common.dart'; 8 import 'package:polymer/src/build/common.dart';
9 import 'package:polymer/src/build/import_inliner.dart'; 9 import 'package:polymer/src/build/import_inliner.dart';
10 import 'package:polymer/src/build/messages.dart'; 10 import 'package:polymer/src/build/messages.dart';
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 'h1 { font-size: 10px; }', 1021 'h1 { font-size: 10px; }',
1022 }, { 1022 }, {
1023 'a|web/test.html': 1023 'a|web/test.html':
1024 '<!DOCTYPE html><html><head></head><body>' 1024 '<!DOCTYPE html><html><head></head><body>'
1025 '<link rel="stylesheet" href="bar.css">' 1025 '<link rel="stylesheet" href="bar.css">'
1026 '<style>h1 { font-size: 70px; }</style>' 1026 '<style>h1 { font-size: 70px; }</style>'
1027 '<style>h1 { font-size: 20px; }</style>' 1027 '<style>h1 { font-size: 20px; }</style>'
1028 '<link rel="stylesheet" href="packages/c/buz.css">' 1028 '<link rel="stylesheet" href="packages/c/buz.css">'
1029 '</body></html>', 1029 '</body></html>',
1030 }); 1030 });
1031
1032 testLogOutput(
1033 (options) => new ImportInliner(options),
1034 'warns about multiple inlinings of the same css', {
1035 'a|web/test.html':
1036 '<!DOCTYPE html><html><head>'
1037 '<link rel="stylesheet" href="packages/a/foo.css">'
1038 '<link rel="stylesheet" href="packages/a/foo.css">'
1039 '</head><body></body></html>',
1040 'a|web/test1.html':
1041 '<!DOCTYPE html><html><head>'
1042 '<link rel="stylesheet" href="packages/a/foo.css">'
1043 '<link rel="import" href="packages/a/import1.html">'
1044 '</head><body></body></html>',
1045 'a|web/test2.html':
1046 '<!DOCTYPE html><html><head>'
1047 '<link rel="import" href="packages/a/import1.html">'
1048 '<link rel="import" href="packages/a/import2.html">'
1049 '</head><body></body></html>',
1050 'a|lib/import1.html':
1051 '<link rel="stylesheet" href="foo.css">',
1052 'a|lib/import2.html':
1053 '<link rel="stylesheet" href="foo.css">',
1054 'a|lib/foo.css':
1055 'body {position: relative;}',
1056 }, {}, [
1057 'warning: ${CSS_FILE_INLINED_MULTIPLE_TIMES.create(
1058 {'url': 'lib/foo.css'}).snippet}'
1059 ' (web/test.html 0 76)',
1060 'warning: ${CSS_FILE_INLINED_MULTIPLE_TIMES.create(
1061 {'url': 'lib/foo.css'}).snippet}'
1062 ' (lib/import1.html 0 0)',
1063 'warning: ${CSS_FILE_INLINED_MULTIPLE_TIMES.create(
1064 {'url': 'lib/foo.css'}).snippet}'
1065 ' (lib/import2.html 0 0)',
1066 ]);
1067
1068 testPhases(
1069 'doesn\'t warn about multiple css inlinings if overriden',
1070 [[new ImportInliner(new TransformOptions(
1071 inlineStylesheets: {'lib/foo.css': true}))]], {
1072 'a|web/test.html':
1073 '<!DOCTYPE html><html><head>'
1074 '<link rel="stylesheet" href="packages/a/foo.css">'
1075 '<link rel="stylesheet" href="packages/a/foo.css">'
1076 '</head><body></body></html>',
1077 'a|web/test1.html':
1078 '<!DOCTYPE html><html><head>'
1079 '<link rel="stylesheet" href="packages/a/foo.css">'
1080 '<link rel="import" href="packages/a/import1.html">'
1081 '</head><body></body></html>',
1082 'a|web/test2.html':
1083 '<!DOCTYPE html><html><head>'
1084 '<link rel="import" href="packages/a/import1.html">'
1085 '<link rel="import" href="packages/a/import2.html">'
1086 '</head><body></body></html>',
1087 'a|lib/import1.html':
1088 '<link rel="stylesheet" href="foo.css">',
1089 'a|lib/import2.html':
1090 '<link rel="stylesheet" href="foo.css">',
1091 'a|lib/foo.css':
1092 'body {position: relative;}',
1093 }, {}, []);
1031 } 1094 }
1032 1095
1033 void urlAttributeTests() { 1096 void urlAttributeTests() {
1034 1097
1035 testPhases('url attributes are normalized', phases, { 1098 testPhases('url attributes are normalized', phases, {
1036 'a|web/test.html': 1099 'a|web/test.html':
1037 '<!DOCTYPE html><html><head>' 1100 '<!DOCTYPE html><html><head>'
1038 '<link rel="import" href="foo/test_1.html">' 1101 '<link rel="import" href="foo/test_1.html">'
1039 '<link rel="import" href="foo/test_2.html">' 1102 '<link rel="import" href="foo/test_2.html">'
1040 '</head></html>', 1103 '</head></html>',
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 'console.log("here");', 1268 'console.log("here");',
1206 }, { 1269 }, {
1207 'a|web/test/well/test.html': 1270 'a|web/test/well/test.html':
1208 '<!DOCTYPE html><html><head></head><body>' 1271 '<!DOCTYPE html><html><head></head><body>'
1209 '<div hidden="">' 1272 '<div hidden="">'
1210 '<script rel="import" href="../../packages/b/bar/bar.js"></script>' 1273 '<script rel="import" href="../../packages/b/bar/bar.js"></script>'
1211 '</div>' 1274 '</div>'
1212 '</body></html>', 1275 '</body></html>',
1213 }); 1276 });
1214 } 1277 }
OLDNEW
« 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