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

Side by Side Diff: pkg/polymer/test/build/script_compactor_test.dart

Issue 47933006: Build fixes: adds arguments to the pub-build plugin to configure whether 'js' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
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.script_compactor_test; 5 library polymer.test.build.script_compactor_test;
6 6
7 import 'package:polymer/src/build/common.dart'; 7 import 'package:polymer/src/build/common.dart';
8 import 'package:polymer/src/build/script_compactor.dart'; 8 import 'package:polymer/src/build/script_compactor.dart';
9 import 'package:unittest/compact_vm_config.dart'; 9 import 'package:unittest/compact_vm_config.dart';
10 10
(...skipping 18 matching lines...) Expand all
29 'a|lib/test.html': 29 'a|lib/test.html':
30 '<!DOCTYPE html><html><head>' 30 '<!DOCTYPE html><html><head>'
31 '<script type="application/dart" src="a.dart"></script>', 31 '<script type="application/dart" src="a.dart"></script>',
32 }); 32 });
33 33
34 testPhases('single script', phases, { 34 testPhases('single script', phases, {
35 'a|web/test.html': 35 'a|web/test.html':
36 '<!DOCTYPE html><html><head>' 36 '<!DOCTYPE html><html><head>'
37 '<script type="application/dart" src="a.dart"></script>', 37 '<script type="application/dart" src="a.dart"></script>',
38 'a|web/test.html.scriptUrls': '[]', 38 'a|web/test.html.scriptUrls': '[]',
39 'a|web/a.dart': 'library a;\nmain(){}',
39 }, { 40 }, {
40 'a|web/test.html': 41 'a|web/test.html':
41 '<!DOCTYPE html><html><head>' 42 '<!DOCTYPE html><html><head>'
42 '<script type="application/dart" ' 43 '<script type="application/dart" '
43 'src="test.html_bootstrap.dart"></script>' 44 'src="test.html_bootstrap.dart"></script>'
44 '</head><body></body></html>', 45 '</head><body></body></html>',
45 46
46 'a|web/test.html_bootstrap.dart': 47 'a|web/test.html_bootstrap.dart':
47 '''$MAIN_HEADER 48 '''$MAIN_HEADER
48 import 'a.dart' as i0; 49 import 'a.dart_modified.dart' as i0;
49 50
50 void main() { 51 void main() {
51 configureForDeployment([ 52 configureForDeployment([
52 'a.dart', 53 'a.dart_modified.dart',
53 ]); 54 ]);
54 i0.main(); 55 i0.polymerMainWrapper();
55 } 56 }
56 '''.replaceAll('\n ', '\n'), 57 '''.replaceAll('\n ', '\n'),
58 'a|web/a.dart': 'library a;\nmain(){}',
59 'a|web/a.dart_modified.dart':
60 'library a;\nmain(){}'
61 '\n\npolymerMainWrapper() => main();\n',
57 }); 62 });
58 63
59 testPhases('several scripts', phases, { 64 testPhases('several scripts', phases, {
60 'a|web/test.html': 65 'a|web/test.html':
61 '<!DOCTYPE html><html><head>' 66 '<!DOCTYPE html><html><head>'
62 '</head><body><div>' 67 '</head><body><div>'
63 '<script type="application/dart" src="d.dart"></script>' 68 '<script type="application/dart" src="d.dart"></script>'
64 '</div>', 69 '</div>',
65 'a|web/test.html.scriptUrls': 70 'a|web/test.html.scriptUrls':
66 '[["a", "web/a.dart"],["a", "web/b.dart"],["a", "web/c.dart"]]', 71 '[["a", "web/a.dart"],["a", "web/b.dart"],["a", "web/c.dart"]]',
72 'a|web/d.dart': 'library d;\nmain(){}',
67 }, { 73 }, {
68 'a|web/test.html': 74 'a|web/test.html':
69 '<!DOCTYPE html><html><head></head><body><div>' 75 '<!DOCTYPE html><html><head></head><body><div>'
70 '<script type="application/dart" src="test.html_bootstrap.dart">' 76 '<script type="application/dart" src="test.html_bootstrap.dart">'
71 '</script>' 77 '</script>'
72 '</div>' 78 '</div>'
73 '</body></html>', 79 '</body></html>',
74 80
75 'a|web/test.html_bootstrap.dart': 81 'a|web/test.html_bootstrap.dart':
76 '''$MAIN_HEADER 82 '''$MAIN_HEADER
77 import 'a.dart' as i0; 83 import 'a.dart' as i0;
78 import 'b.dart' as i1; 84 import 'b.dart' as i1;
79 import 'c.dart' as i2; 85 import 'c.dart' as i2;
80 import 'd.dart' as i3; 86 import 'd.dart_modified.dart' as i3;
81 87
82 void main() { 88 void main() {
83 configureForDeployment([ 89 configureForDeployment([
84 'a.dart', 90 'a.dart',
85 'b.dart', 91 'b.dart',
86 'c.dart', 92 'c.dart',
87 'd.dart', 93 'd.dart_modified.dart',
88 ]); 94 ]);
89 i3.main(); 95 i3.polymerMainWrapper();
90 } 96 }
91 '''.replaceAll('\n ', '\n'), 97 '''.replaceAll('\n ', '\n'),
92 }); 98 });
93 } 99 }
OLDNEW
« pkg/polymer/lib/transformer.dart ('K') | « pkg/polymer/test/build/all_phases_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698