| 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.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 PolyfillInjector()]], { | 15 testPhases('no changes', [[new PolyfillInjector()]], { |
| 16 'a|web/test.html': '<!DOCTYPE html><html></html>', | 16 'a|web/test.html': '<!DOCTYPE html><html></html>', |
| 17 }, { | 17 }, { |
| 18 'a|web/test.html': '<!DOCTYPE html><html></html>', | 18 'a|web/test.html': '<!DOCTYPE html><html></html>', |
| 19 }); | 19 }); |
| 20 | 20 |
| 21 testPhases('no changes under lib ', [[new PolyfillInjector()]], { |
| 22 'a|lib/test.html': |
| 23 '<!DOCTYPE html><html><head></head><body>' |
| 24 '<script type="application/dart" src="a.dart"></script>', |
| 25 }, { |
| 26 'a|lib/test.html': |
| 27 '<!DOCTYPE html><html><head></head><body>' |
| 28 '<script type="application/dart" src="a.dart"></script>', |
| 29 }); |
| 30 |
| 21 testPhases('with some script', [[new PolyfillInjector()]], { | 31 testPhases('with some script', [[new PolyfillInjector()]], { |
| 22 'a|web/test.html': | 32 'a|web/test.html': |
| 23 '<!DOCTYPE html><html><head></head><body>' | 33 '<!DOCTYPE html><html><head></head><body>' |
| 24 '<script type="application/dart" src="a.dart"></script>', | 34 '<script type="application/dart" src="a.dart"></script>', |
| 25 }, { | 35 }, { |
| 26 'a|web/test.html': | 36 'a|web/test.html': |
| 27 '<!DOCTYPE html><html><head></head><body>' | 37 '<!DOCTYPE html><html><head></head><body>' |
| 28 '$SHADOW_DOM_TAG$INTEROP_TAG' | 38 '$SHADOW_DOM_TAG$INTEROP_TAG' |
| 29 '<script type="application/dart" src="a.dart"></script>' | 39 '<script type="application/dart" src="a.dart"></script>' |
| 30 '</body></html>', | 40 '</body></html>', |
| 31 }); | 41 }); |
| 32 | 42 |
| 33 testPhases('interop/shadow dom already present', [[new PolyfillInjector()]], { | 43 testPhases('interop/shadow dom already present', [[new PolyfillInjector()]], { |
| 34 'a|web/test.html': | 44 'a|web/test.html': |
| 35 '<!DOCTYPE html><html><head></head><body>' | 45 '<!DOCTYPE html><html><head></head><body>' |
| 36 '<script type="application/dart" src="a.dart"></script>' | 46 '<script type="application/dart" src="a.dart"></script>' |
| 37 '$SHADOW_DOM_TAG' | 47 '$SHADOW_DOM_TAG' |
| 38 '$INTEROP_TAG', | 48 '$INTEROP_TAG', |
| 39 }, { | 49 }, { |
| 40 'a|web/test.html': | 50 'a|web/test.html': |
| 41 '<!DOCTYPE html><html><head></head><body>' | 51 '<!DOCTYPE html><html><head></head><body>' |
| 42 '<script type="application/dart" src="a.dart"></script>' | 52 '<script type="application/dart" src="a.dart"></script>' |
| 43 '$SHADOW_DOM_TAG' | 53 '$SHADOW_DOM_TAG' |
| 44 '$INTEROP_TAG</body></html>', | 54 '$INTEROP_TAG</body></html>', |
| 45 }); | 55 }); |
| 46 } | 56 } |
| OLD | NEW |