| 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.polyfill_injector_test; | 5 library polymer.test.transform.polyfill_injector_test; |
| 6 | 6 |
| 7 import 'package:polymer/src/transform.dart'; | 7 import 'package:polymer/src/transform/common.dart'; |
| 8 import 'package:polymer/src/transform/polyfill_injector.dart'; |
| 8 import 'package:unittest/compact_vm_config.dart'; | 9 import 'package:unittest/compact_vm_config.dart'; |
| 9 | 10 |
| 10 import 'common.dart'; | 11 import 'common.dart'; |
| 11 | 12 |
| 12 void main() { | 13 void main() { |
| 13 useCompactVMConfiguration(); | 14 useCompactVMConfiguration(); |
| 15 var phases = [[new PolyfillInjector(new TransformOptions())]]; |
| 14 | 16 |
| 15 testPhases('no changes', [[new PolyfillInjector()]], { | 17 testPhases('no changes', phases, { |
| 16 'a|web/test.html': '<!DOCTYPE html><html></html>', | 18 'a|web/test.html': '<!DOCTYPE html><html></html>', |
| 17 }, { | 19 }, { |
| 18 'a|web/test.html': '<!DOCTYPE html><html></html>', | 20 'a|web/test.html': '<!DOCTYPE html><html></html>', |
| 19 }); | 21 }); |
| 20 | 22 |
| 21 testPhases('no changes under lib ', [[new PolyfillInjector()]], { | 23 testPhases('no changes under lib ', phases, { |
| 22 'a|lib/test.html': | 24 'a|lib/test.html': |
| 23 '<!DOCTYPE html><html><head></head><body>' | 25 '<!DOCTYPE html><html><head></head><body>' |
| 24 '<script type="application/dart" src="a.dart"></script>', | 26 '<script type="application/dart" src="a.dart"></script>', |
| 25 }, { | 27 }, { |
| 26 'a|lib/test.html': | 28 'a|lib/test.html': |
| 27 '<!DOCTYPE html><html><head></head><body>' | 29 '<!DOCTYPE html><html><head></head><body>' |
| 28 '<script type="application/dart" src="a.dart"></script>', | 30 '<script type="application/dart" src="a.dart"></script>', |
| 29 }); | 31 }); |
| 30 | 32 |
| 31 testPhases('with some script', [[new PolyfillInjector()]], { | 33 testPhases('with some script', phases, { |
| 32 'a|web/test.html': | 34 'a|web/test.html': |
| 33 '<!DOCTYPE html><html><head></head><body>' | 35 '<!DOCTYPE html><html><head></head><body>' |
| 34 '<script type="application/dart" src="a.dart"></script>', | 36 '<script type="application/dart" src="a.dart"></script>', |
| 35 }, { | 37 }, { |
| 36 'a|web/test.html': | 38 'a|web/test.html': |
| 37 '<!DOCTYPE html><html><head></head><body>' | 39 '<!DOCTYPE html><html><head></head><body>' |
| 38 '$SHADOW_DOM_TAG$INTEROP_TAG$PKG_JS_INTEROP_TAG' | 40 '$SHADOW_DOM_TAG$INTEROP_TAG$PKG_JS_INTEROP_TAG' |
| 39 '<script type="application/dart" src="a.dart"></script>' | 41 '<script type="application/dart" src="a.dart"></script>' |
| 40 '</body></html>', | 42 '</body></html>', |
| 41 }); | 43 }); |
| 42 | 44 |
| 43 testPhases('interop/shadow dom already present', [[new PolyfillInjector()]], { | 45 testPhases('interop/shadow dom already present', phases, { |
| 44 'a|web/test.html': | 46 'a|web/test.html': |
| 45 '<!DOCTYPE html><html><head></head><body>' | 47 '<!DOCTYPE html><html><head></head><body>' |
| 46 '<script type="application/dart" src="a.dart"></script>' | 48 '<script type="application/dart" src="a.dart"></script>' |
| 47 '$SHADOW_DOM_TAG' | 49 '$SHADOW_DOM_TAG' |
| 48 '$INTEROP_TAG' | 50 '$INTEROP_TAG' |
| 49 '$PKG_JS_INTEROP_TAG', | 51 '$PKG_JS_INTEROP_TAG', |
| 50 }, { | 52 }, { |
| 51 'a|web/test.html': | 53 'a|web/test.html': |
| 52 '<!DOCTYPE html><html><head></head><body>' | 54 '<!DOCTYPE html><html><head></head><body>' |
| 53 '<script type="application/dart" src="a.dart"></script>' | 55 '<script type="application/dart" src="a.dart"></script>' |
| 54 '$SHADOW_DOM_TAG' | 56 '$SHADOW_DOM_TAG' |
| 55 '$INTEROP_TAG' | 57 '$INTEROP_TAG' |
| 56 '$PKG_JS_INTEROP_TAG' | 58 '$PKG_JS_INTEROP_TAG' |
| 57 '</body></html>', | 59 '</body></html>', |
| 58 }); | 60 }); |
| 59 } | 61 } |
| OLD | NEW |