| OLD | NEW |
| 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.transform.script_compactor_test; | 5 library polymer.test.transform.script_compactor_test; |
| 6 | 6 |
| 7 import 'package:polymer/src/transform/script_compactor.dart'; | 7 import 'package:polymer/src/transform/script_compactor.dart'; |
| 8 import 'package:unittest/compact_vm_config.dart'; | 8 import 'package:unittest/compact_vm_config.dart'; |
| 9 | 9 |
| 10 import 'common.dart'; | 10 import 'common.dart'; |
| 11 | 11 |
| 12 void main() { | 12 void main() { |
| 13 useCompactVMConfiguration(); | 13 useCompactVMConfiguration(); |
| 14 | 14 |
| 15 testPhases('no changes', [[new ScriptCompactor()]], { | 15 testPhases('no changes', [[new ScriptCompactor()]], { |
| 16 'a|test.html': '<!DOCTYPE html><html></html>', | 16 'a|test.html': '<!DOCTYPE html><html></html>', |
| 17 }, { | 17 }, { |
| 18 'a|test.html': '<!DOCTYPE html><html></html>', | 18 'a|test.html': '<!DOCTYPE html><html></html>', |
| 19 }); | 19 }); |
| 20 | 20 |
| 21 testPhases('single script', [[new ScriptCompactor()]], { | 21 testPhases('single script', [[new ScriptCompactor()]], { |
| 22 'a|test.html': | 22 'a|test.html': |
| 23 '<!DOCTYPE html><html><head>' | 23 '<!DOCTYPE html><html><head>' |
| 24 '<script type="application/dart" src="a.dart"></script>', | 24 '<script type="application/dart" src="a.dart"></script>', |
| 25 }, { | 25 }, { |
| 26 'a|test.html': | 26 'a|test.html': |
| 27 '<!DOCTYPE html><html><head></head><body>' | 27 '<!DOCTYPE html><html><head></head><body>' |
| 28 '<script type="application/dart" ' | 28 '<script type="application/dart" ' |
| 29 'src="test.html_bootstrap.dart"></script>' | 29 'src="test.html_bootstrap.dart"></script>' |
| 30 '<script type="text/javascript" ' | 30 '<script src="packages/browser/dart.js"></script>' |
| 31 'src="packages/browser/dart.js"></script>' | |
| 32 '</body></html>', | 31 '</body></html>', |
| 33 | 32 |
| 34 'a|test.html_bootstrap.dart': | 33 'a|test.html_bootstrap.dart': |
| 35 '''library app_bootstrap; | 34 '''library app_bootstrap; |
| 36 | 35 |
| 37 import 'package:polymer/polymer.dart'; | 36 import 'package:polymer/polymer.dart'; |
| 38 import 'dart:mirrors' show currentMirrorSystem; | 37 import 'dart:mirrors' show currentMirrorSystem; |
| 39 | 38 |
| 40 import 'a.dart' as i0; | 39 import 'a.dart' as i0; |
| 41 | 40 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 54 '<script type="application/dart" src="b.dart"></script>' | 53 '<script type="application/dart" src="b.dart"></script>' |
| 55 '</head><body><div>' | 54 '</head><body><div>' |
| 56 '<script type="application/dart" src="c.dart"></script>' | 55 '<script type="application/dart" src="c.dart"></script>' |
| 57 '</div>' | 56 '</div>' |
| 58 '<script type="application/dart" src="d.dart"></script>', | 57 '<script type="application/dart" src="d.dart"></script>', |
| 59 }, { | 58 }, { |
| 60 'a|test.html': | 59 'a|test.html': |
| 61 '<!DOCTYPE html><html><head></head><body><div></div>' | 60 '<!DOCTYPE html><html><head></head><body><div></div>' |
| 62 '<script type="application/dart" ' | 61 '<script type="application/dart" ' |
| 63 'src="test.html_bootstrap.dart"></script>' | 62 'src="test.html_bootstrap.dart"></script>' |
| 64 '<script type="text/javascript" ' | 63 '<script src="packages/browser/dart.js"></script>' |
| 65 'src="packages/browser/dart.js"></script>' | |
| 66 '</body></html>', | 64 '</body></html>', |
| 67 | 65 |
| 68 'a|test.html_bootstrap.dart': | 66 'a|test.html_bootstrap.dart': |
| 69 '''library app_bootstrap; | 67 '''library app_bootstrap; |
| 70 | 68 |
| 71 import 'package:polymer/polymer.dart'; | 69 import 'package:polymer/polymer.dart'; |
| 72 import 'dart:mirrors' show currentMirrorSystem; | 70 import 'dart:mirrors' show currentMirrorSystem; |
| 73 | 71 |
| 74 import 'a.dart' as i0; | 72 import 'a.dart' as i0; |
| 75 import 'b.dart' as i1; | 73 import 'b.dart' as i1; |
| 76 import 'c.dart' as i2; | 74 import 'c.dart' as i2; |
| 77 import 'd.dart' as i3; | 75 import 'd.dart' as i3; |
| 78 | 76 |
| 79 void main() { | 77 void main() { |
| 80 initPolymer([ | 78 initPolymer([ |
| 81 'a.dart', | 79 'a.dart', |
| 82 'b.dart', | 80 'b.dart', |
| 83 'c.dart', | 81 'c.dart', |
| 84 'd.dart', | 82 'd.dart', |
| 85 ], currentMirrorSystem().isolate.rootLibrary.uri.toString()); | 83 ], currentMirrorSystem().isolate.rootLibrary.uri.toString()); |
| 86 } | 84 } |
| 87 '''.replaceAll('\n ', '\n'), | 85 '''.replaceAll('\n ', '\n'), |
| 88 }); | 86 }); |
| 89 } | 87 } |
| OLD | NEW |