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.build.import_inliner_test; | 5 library polymer.test.build.import_inliner_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/import_inliner.dart'; | 8 import 'package:polymer/src/build/import_inliner.dart'; |
9 import 'package:unittest/compact_vm_config.dart'; | 9 import 'package:unittest/compact_vm_config.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 '</head><body>' | 81 '</head><body>' |
82 '<polymer-element>2</polymer-element>' | 82 '<polymer-element>2</polymer-element>' |
83 '</body></html>', | 83 '</body></html>', |
84 'a|web/test.html.scriptUrls': '[]', | 84 'a|web/test.html.scriptUrls': '[]', |
85 'a|web/test2.html': | 85 'a|web/test2.html': |
86 '<!DOCTYPE html><html><head>' | 86 '<!DOCTYPE html><html><head>' |
87 '</head><body><polymer-element>2</polymer-element></html>', | 87 '</head><body><polymer-element>2</polymer-element></html>', |
88 'a|web/test2.html.scriptUrls': '[]', | 88 'a|web/test2.html.scriptUrls': '[]', |
89 }); | 89 }); |
90 | 90 |
91 testPhases('preserves order of scripts', phases, | |
92 { | |
93 'a|web/test.html': | |
94 '<!DOCTYPE html><html><head>' | |
95 '<script type="text/javascript">/*first*/</script>' | |
96 '<script src="second.js"></script>' | |
97 '<link rel="import" href="test2.html">' | |
98 '<script type="application/dart">/*forth*/</script>' | |
99 '</head></html>', | |
100 'a|web/test2.html': | |
101 '<!DOCTYPE html><html><head><script>/*third*/</script>' | |
102 '</head><body><polymer-element>2</polymer-element></html>', | |
103 'a|web/second.js': '/*second*/' | |
104 }, { | |
105 'a|web/test.html': | |
106 '<!DOCTYPE html><html><head>' | |
107 '</head><body>' | |
108 '<script type="text/javascript">/*first*/</script>' | |
109 '<script src="second.js"></script>' | |
110 '<script>/*third*/</script>' | |
Siggi Cherem (dart-lang)
2014/02/20 03:50:55
I assume this would have been below /*forth*/ if y
Jennifer Messerly
2014/02/20 03:56:07
yeah. Without the change 1, 2 and 4 would be left
| |
111 '<polymer-element>2</polymer-element>' | |
112 '<script type="application/dart">/*forth*/</script>' | |
113 '</body></html>', | |
114 'a|web/test.html.scriptUrls': '[]', | |
115 'a|web/test2.html': | |
116 '<!DOCTYPE html><html><head><script>/*third*/</script>' | |
117 '</head><body><polymer-element>2</polymer-element></html>', | |
118 'a|web/test2.html.scriptUrls': '[]', | |
119 'a|web/second.js': '/*second*/' | |
120 }); | |
121 | |
91 testPhases('no transformation outside web/', phases, | 122 testPhases('no transformation outside web/', phases, |
92 { | 123 { |
93 'a|lib/test.html': | 124 'a|lib/test.html': |
94 '<!DOCTYPE html><html><head>' | 125 '<!DOCTYPE html><html><head>' |
95 '<link rel="import" href="test2.html">' | 126 '<link rel="import" href="test2.html">' |
96 '</head></html>', | 127 '</head></html>', |
97 'a|lib/test2.html': | 128 'a|lib/test2.html': |
98 '<!DOCTYPE html><html><head>' | 129 '<!DOCTYPE html><html><head>' |
99 '</head><body><polymer-element>2</polymer-element></html>', | 130 '</head><body><polymer-element>2</polymer-element></html>', |
100 }, { | 131 }, { |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
557 | 588 |
558 testPhases('shallow, inlines css', phases, { | 589 testPhases('shallow, inlines css', phases, { |
559 'a|web/test.html': | 590 'a|web/test.html': |
560 '<!DOCTYPE html><html><head>' | 591 '<!DOCTYPE html><html><head>' |
561 '<link rel="stylesheet" href="test2.css">' | 592 '<link rel="stylesheet" href="test2.css">' |
562 '</head></html>', | 593 '</head></html>', |
563 'a|web/test2.css': | 594 'a|web/test2.css': |
564 'h1 { font-size: 70px; }', | 595 'h1 { font-size: 70px; }', |
565 }, { | 596 }, { |
566 'a|web/test.html': | 597 'a|web/test.html': |
567 '<!DOCTYPE html><html><head>' | 598 '<!DOCTYPE html><html><head></head><body>' |
568 '<style>h1 { font-size: 70px; }</style>' | 599 '<style>h1 { font-size: 70px; }</style>' |
569 '</head><body></body></html>', | 600 '</body></html>', |
570 'a|web/test.html.scriptUrls': '[]', | 601 'a|web/test.html.scriptUrls': '[]', |
571 'a|web/test2.css': | 602 'a|web/test2.css': |
572 'h1 { font-size: 70px; }', | 603 'h1 { font-size: 70px; }', |
573 }); | 604 }); |
574 | 605 |
575 testPhases('deep, inlines css', phases, { | 606 testPhases('deep, inlines css', phases, { |
576 'a|web/test.html': | 607 'a|web/test.html': |
577 '<!DOCTYPE html><html><head>' | 608 '<!DOCTYPE html><html><head>' |
578 '<link rel="import" href="test2.html">' | 609 '<link rel="import" href="test2.html">' |
579 '</head></html>', | 610 '</head></html>', |
(...skipping 24 matching lines...) Expand all Loading... | |
604 '.foo {\n background: url(packages/c/test5.png);\n}' | 635 '.foo {\n background: url(packages/c/test5.png);\n}' |
605 '</style>' | 636 '</style>' |
606 '</polymer-element>' | 637 '</polymer-element>' |
607 '</body></html>', | 638 '</body></html>', |
608 'b|asset/test3.css': | 639 'b|asset/test3.css': |
609 'body {\n background: #eaeaea url("assets/b/test4.png");\n}\n' | 640 'body {\n background: #eaeaea url("assets/b/test4.png");\n}\n' |
610 '.foo {\n background: url("../../packages/c/test5.png");\n}', | 641 '.foo {\n background: url("../../packages/c/test5.png");\n}', |
611 'b|asset/test4.png': 'PNG', | 642 'b|asset/test4.png': 'PNG', |
612 'c|lib/test5.png': 'PNG', | 643 'c|lib/test5.png': 'PNG', |
613 }); | 644 }); |
645 | |
646 | |
647 testPhases('shallow, inlines css and preserves order', phases, { | |
648 'a|web/test.html': | |
649 '<!DOCTYPE html><html><head>' | |
650 '<style>.first { color: black }</style>' | |
651 '<link rel="stylesheet" href="test2.css">' | |
652 '<style>.second { color: black }</style>' | |
653 '</head></html>', | |
654 'a|web/test2.css': | |
655 'h1 { font-size: 70px; }', | |
656 }, { | |
657 'a|web/test.html': | |
658 '<!DOCTYPE html><html><head></head><body>' | |
659 '<style>.first { color: black }</style>' | |
660 '<style>h1 { font-size: 70px; }</style>' | |
661 '<style>.second { color: black }</style>' | |
662 '</body></html>', | |
663 'a|web/test.html.scriptUrls': '[]', | |
664 'a|web/test2.css': | |
665 'h1 { font-size: 70px; }', | |
666 }); | |
667 | |
614 } | 668 } |
OLD | NEW |