OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
esprehn
2014/05/20 06:54:05
ditto, the you need a doctype unless your test rea
| |
2 <head> | |
3 <script src="../../../resources/js-test.js"></script> | |
4 <script> | |
5 if (window.testRunner) | |
6 testRunner.dumpAsText(); | |
7 | |
8 addEventListener("load", function() { | |
9 shouldBe('document.getElementById("canary").clientWidth', '75'); | |
10 shouldBe('document.getElementById("canary").currentSrc', '"resources/blu e_rect.jpg?0"'); | |
11 shouldBe('document.getElementById("div_end_picture").clientWidth', '800' ); | |
12 shouldBe('document.getElementById("div_end_picture").currentSrc', '"../. ./hidpi/resources/image-set-2x.png?2"'); | |
13 shouldBe('document.getElementById("div_multiple_end").clientWidth', '800 '); | |
14 shouldBe('document.getElementById("div_multiple_end").currentSrc', '"../ ../hidpi/resources/image-set-2x.png?2"'); | |
15 shouldBe('document.getElementById("source_in_div").clientWidth', '75'); | |
16 shouldBe('document.getElementById("source_in_div").currentSrc', '"resour ces/blue_rect.jpg"'); | |
17 shouldBe('document.getElementById("not_in_picture").clientWidth', '75'); | |
18 shouldBe('document.getElementById("not_in_picture").currentSrc', '"resou rces/blue_rect.jpg"'); | |
19 }, false); | |
20 </script> | |
21 </head> | |
22 | |
23 <body id="body"> | |
24 <!-- A canary image to see that the test is actually working --> | |
25 <img id="canary" src="resources/blue_rect.jpg?0"> | |
26 <!-- Invalid nesting tests --> | |
27 <!-- In the following tests, nesting shouldn't mess up the selection algorit hm --> | |
28 <picture> | |
29 <picture> | |
30 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png ?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, | |
31 resources/image-set-4x.png?2 1600w"> | |
32 <div> | |
33 </picture> | |
34 </div> | |
35 <img id="div_end_picture" src="resources/blue_rect.jpg"> | |
36 </picture> | |
37 </picture> | |
38 <picture> | |
39 <div> | |
40 </picture> | |
41 </picture> | |
42 </picture> | |
43 </div> | |
44 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 4 00w, ../../hidpi/resources/image-set-2x.png?2 800w, | |
45 resources/image-set-4x.png?2 1600w"> | |
46 <img id="div_multiple_end" src="resources/blue_rect.jpg"> | |
47 </picture> | |
48 <!-- In the following tests, nesting messes up the selection algorithm --> | |
49 <picture> | |
50 <div> | |
51 <picture> | |
52 <div> | |
53 <source sizes="400px" srcset="resources/base-image1.png?4 20 0w, resources/base-image3.png?4 400w, resources/base-image2.png?4 800w"> | |
54 </div> | |
55 <img id="source_in_div" src="resources/blue_rect.jpg"> | |
56 </picture> | |
57 </div> | |
58 </picture> | |
59 <picture> | |
60 <div> | |
61 <picture> | |
62 <div> | |
63 <source sizes="400px" srcset="resources/base-image1.png?5 20 0w, resources/base-image3.png?5 400w, resources/base-image2.png?5 800w"> | |
64 <img id="not_in_picture" src="resources/blue_rect.jpg"> | |
65 </div> | |
66 </picture> | |
67 </div> | |
68 </picture> | |
69 </body> | |
70 </html> | |
OLD | NEW |