| Index: pkg/polymer/test/build/code_extractor.dart
|
| diff --git a/pkg/polymer/test/build/code_extractor.dart b/pkg/polymer/test/build/code_extractor.dart
|
| index beeafcbbd4c365f458870d6186b989c14e75a62d..813d13d80a3858ac0b96b17b7b23d21e4ab1fd10 100644
|
| --- a/pkg/polymer/test/build/code_extractor.dart
|
| +++ b/pkg/polymer/test/build/code_extractor.dart
|
| @@ -164,6 +164,7 @@ void codeExtractorTests() {
|
| });
|
|
|
| group('fixes import/export/part URIs', dartUriTests);
|
| + group('validates script-tag URIs', validateUriTests);
|
| }
|
|
|
| dartUriTests() {
|
| @@ -312,3 +313,55 @@ dartUriTests() {
|
| '</body></html>',
|
| });
|
| }
|
| +
|
| +validateUriTests() {
|
| +
|
| + testPhases('script is inline', phases, {
|
| + 'a|web/test.html':
|
| + '<!DOCTYPE html><html><body>'
|
| + '<script type="application/dart;component=1">'
|
| + 'main(){}'
|
| + '</script>'
|
| + '</body></html>',
|
| + }, {
|
| + 'a|web/test.html.scriptUrls': '[["a","web/test.html.0.dart"]]',
|
| + }, []);
|
| +
|
| + testPhases('script src is valid', phases, {
|
| + 'a|web/test.html':
|
| + '<!DOCTYPE html><html><body>'
|
| + '<script type="application/dart;component=1" src="a.dart"></script>'
|
| + '</body></html>',
|
| + 'a|web/a.dart': 'main() {}',
|
| + }, {
|
| + 'a|web/test.html.scriptUrls': '[["a","web/a.dart"]]',
|
| + }, []);
|
| +
|
| + testPhases('script src is invalid', phases, {
|
| + 'a|web/test.html':
|
| + '<!DOCTYPE html><html><body>\n'
|
| + '<script type="application/dart;component=1" src="a.dart"></script>'
|
| + '</body></html>',
|
| + }, {
|
| + 'a|web/test.html.scriptUrls': '[]',
|
| + }, [
|
| + 'warning: Script file at "a.dart" not found. (web/test.html 1 0)',
|
| + ]);
|
| +
|
| + testPhases('many script src around, valid and invalid', phases, {
|
| + 'a|web/test.html':
|
| + '<!DOCTYPE html><html><body>'
|
| + '<script type="application/dart;component=1" src="a.dart"></script>'
|
| + '\n<script type="application/dart;component=1" src="b.dart"></script>'
|
| + '\n<script type="application/dart;component=1" src="c.dart"></script>'
|
| + '\n<script type="application/dart;component=1" src="d.dart"></script>'
|
| + '</body></html>',
|
| + 'a|web/a.dart': 'main() {}',
|
| + 'a|web/c.dart': 'main() {}',
|
| + }, {
|
| + 'a|web/test.html.scriptUrls': '[["a","web/a.dart"],["a","web/c.dart"]]',
|
| + }, [
|
| + 'warning: Script file at "b.dart" not found. (web/test.html 1 0)',
|
| + 'warning: Script file at "d.dart" not found. (web/test.html 3 0)',
|
| + ]);
|
| +}
|
|
|