OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
| 3 <script src="resources/currentSrcHelper.js"></script> |
3 <script> | 4 <script> |
4 if (window.testRunner) | 5 if (window.testRunner) |
5 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
6 | 7 |
7 addEventListener("load", function() { | 8 addEventListener("load", function() { |
8 shouldBe('document.getElementById("canary").clientWidth', '75'); | 9 shouldBe('document.getElementById("canary").clientWidth', '75'); |
9 shouldBe('document.getElementById("canary").currentSrc', '"resources/blu
e_rect.jpg?0"'); | 10 shouldBe('currentSrcFileName("canary")', '"blue_rect.jpg?0"'); |
10 shouldBe('document.getElementById("div_end_picture").clientWidth', '800'
); | 11 shouldBe('document.getElementById("div_end_picture").clientWidth', '800'
); |
11 shouldBe('document.getElementById("div_end_picture").currentSrc', '"../.
./hidpi/resources/image-set-2x.png?2"'); | 12 shouldBe('currentSrcFileName("div_end_picture")', '"image-set-2x.png?2"'
); |
12 shouldBe('document.getElementById("div_multiple_end").clientWidth', '800
'); | 13 shouldBe('document.getElementById("div_multiple_end").clientWidth', '800
'); |
13 shouldBe('document.getElementById("div_multiple_end").currentSrc', '"../
../hidpi/resources/image-set-2x.png?2"'); | 14 shouldBe('currentSrcFileName("div_multiple_end")', '"image-set-2x.png?2"
'); |
14 shouldBe('document.getElementById("source_in_div").clientWidth', '75'); | 15 shouldBe('document.getElementById("source_in_div").clientWidth', '75'); |
15 shouldBe('document.getElementById("source_in_div").currentSrc', '"resour
ces/blue_rect.jpg"'); | 16 shouldBe('currentSrcFileName("source_in_div")', '"blue_rect.jpg"'); |
16 shouldBe('document.getElementById("not_in_picture").clientWidth', '75'); | 17 shouldBe('document.getElementById("not_in_picture").clientWidth', '75'); |
17 shouldBe('document.getElementById("not_in_picture").currentSrc', '"resou
rces/blue_rect.jpg"'); | 18 shouldBe('currentSrcFileName("not_in_picture")', '"blue_rect.jpg"'); |
18 }, false); | 19 }, false); |
19 </script> | 20 </script> |
20 <!-- A canary image to see that the test is actually working --> | 21 <!-- A canary image to see that the test is actually working --> |
21 <img id="canary" src="resources/blue_rect.jpg?0"> | 22 <img id="canary" src="resources/blue_rect.jpg?0"> |
22 <!-- Invalid nesting tests --> | 23 <!-- Invalid nesting tests --> |
23 <!-- In the following tests, nesting shouldn't mess up the selection algorithm -
-> | 24 <!-- In the following tests, nesting shouldn't mess up the selection algorithm -
-> |
24 <picture> | 25 <picture> |
25 <picture> | 26 <picture> |
26 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 4
00w, ../../hidpi/resources/image-set-2x.png?2 800w, | 27 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 4
00w, ../../hidpi/resources/image-set-2x.png?2 800w, |
27 resources/image-set-4x.png?2 1600w"> | 28 resources/image-set-4x.png?2 1600w"> |
(...skipping 27 matching lines...) Expand all Loading... |
55 <picture> | 56 <picture> |
56 <div> | 57 <div> |
57 <picture> | 58 <picture> |
58 <div> | 59 <div> |
59 <source sizes="400px" srcset="resources/base-image1.png?5 200w,
resources/base-image3.png?5 400w, resources/base-image2.png?5 800w"> | 60 <source sizes="400px" srcset="resources/base-image1.png?5 200w,
resources/base-image3.png?5 400w, resources/base-image2.png?5 800w"> |
60 <img id="not_in_picture" src="resources/blue_rect.jpg"> | 61 <img id="not_in_picture" src="resources/blue_rect.jpg"> |
61 </div> | 62 </div> |
62 </picture> | 63 </picture> |
63 </div> | 64 </div> |
64 </picture> | 65 </picture> |
OLD | NEW |