OLD | NEW |
---|---|
1 <html> | 1 <html> |
esprehn
2014/05/20 06:54:05
All of these tests need doctypes
| |
2 <head> | 2 <head> |
3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
4 <script> | 4 <script> |
5 if (window.testRunner) | 5 if (window.testRunner) |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 | 7 |
8 addEventListener("load", function() { | 8 addEventListener("load", function() { |
9 shouldBe('document.getElementById("simple").clientWidth', '(window.inner Width)'); | 9 shouldBe('document.getElementById("simple").clientWidth', '(window.inner Width)'); |
10 shouldBe('document.getElementById("simple").currentSrc', '"../../hidpi/r esources/image-set-2x.png"'); | 10 shouldBe('document.getElementById("simple").currentSrc', '"../../hidpi/r esources/image-set-2x.png"'); |
11 shouldBe('document.getElementById("small_sizes").clientWidth', '300'); | 11 shouldBe('document.getElementById("small_sizes").clientWidth', '300'); |
(...skipping 20 matching lines...) Expand all Loading... | |
32 shouldBe('document.getElementById("half_size").currentSrc', '"../../hidp i/resources/image-set-2x.png"'); | 32 shouldBe('document.getElementById("half_size").currentSrc', '"../../hidp i/resources/image-set-2x.png"'); |
33 shouldBe('document.getElementById("infitisimal_sizes").clientWidth', '(w indow.innerWidth/100)'); | 33 shouldBe('document.getElementById("infitisimal_sizes").clientWidth', '(w indow.innerWidth/100)'); |
34 shouldBe('document.getElementById("infitisimal_sizes").currentSrc', '".. /../hidpi/resources/image-set-2x.png"'); | 34 shouldBe('document.getElementById("infitisimal_sizes").currentSrc', '".. /../hidpi/resources/image-set-2x.png"'); |
35 }, false); | 35 }, false); |
36 </script> | 36 </script> |
37 </head> | 37 </head> |
38 | 38 |
39 <body id="body"> | 39 <body id="body"> |
40 <img id="simple" src="" sizes="(max-width: 300px) 400px, 800px" srcset="../. ./hidpi/resources/image-set-1x.png 400w, ../../hidpi/resources/image-set-2x.png 800w"> | 40 <img id="simple" src="" sizes="(max-width: 300px) 400px, 800px" srcset="../. ./hidpi/resources/image-set-1x.png 400w, ../../hidpi/resources/image-set-2x.png 800w"> |
41 <img id="small_sizes" src="" sizes="300px" srcset="../../hidpi/resources/ima ge-set-1x.png 400w, ../../hidpi/resources/image-set-2x.png 800w"> | 41 <img id="small_sizes" src="" sizes="300px" srcset="../../hidpi/resources/ima ge-set-1x.png 400w, ../../hidpi/resources/image-set-2x.png 800w"> |
42 <!-- 'sizes' has no imapct on 'x' or 'src' resources --> | 42 <!-- 'sizes' has no impact on 'x' or 'src' resources --> |
43 <img id="sizes_x_descriptors" src="" sizes="50vw" srcset="../../hidpi/resour ces/image-set-1x.png 1x, ../../hidpi/resources/image-set-2x.png 2x"> | 43 <img id="sizes_x_descriptors" src="" sizes="50vw" srcset="../../hidpi/resour ces/image-set-1x.png 1x, ../../hidpi/resources/image-set-2x.png 2x"> |
44 <img id="sizes_src" src="../../hidpi/resources/image-set-1x.png" sizes="50vw "> | 44 <img id="sizes_src" src="../../hidpi/resources/image-set-1x.png" sizes="50vw "> |
45 <!-- Missing sizes or an invalid one, give a source size of 100vw --> | 45 <!-- Missing sizes or an invalid one, give a source size of 100vw --> |
46 <img id="default_sizes" src="" srcset="../../hidpi/resources/image-set-1x.pn g 400w, ../../hidpi/resources/image-set-2x.png 800w, resources/image-set-4x.png 1600w"> | 46 <img id="default_sizes" src="" srcset="../../hidpi/resources/image-set-1x.pn g 400w, ../../hidpi/resources/image-set-2x.png 800w, resources/image-set-4x.png 1600w"> |
47 <img id="invalid_length" src="" sizes="(max-width: 300px) 400w, 800w" srcset ="../../hidpi/resources/image-set-1x.png 400w, ../../hidpi/resources/image-set-2 x.png 800w"> | 47 <img id="invalid_length" src="" sizes="(max-width: 300px) 400w, 800w" srcset ="../../hidpi/resources/image-set-1x.png 400w, ../../hidpi/resources/image-set-2 x.png 800w"> |
48 <!-- Make sure that the img src is not picked when 'w' is present --> | 48 <!-- Make sure that the img src is not picked when 'w' is present --> |
49 <img id="src_and_w" src="../../hidpi/resources/image-set-1x.png" sizes="700p x" srcset="resources/image-set-4x.png 1600w"> | 49 <img id="src_and_w" src="../../hidpi/resources/image-set-1x.png" sizes="700p x" srcset="resources/image-set-4x.png 1600w"> |
50 <img id="src_and_w2" src="../../hidpi/resources/image-set-2x.png" sizes="700 px" srcset="../../hidpi/resources/image-set-1x.png 400w"> | 50 <img id="src_and_w2" src="../../hidpi/resources/image-set-2x.png" sizes="700 px" srcset="../../hidpi/resources/image-set-1x.png 400w"> |
51 <img id="x_and_w" sizes="700px" srcset="../../hidpi/resources/image-set-1x.p ng 0.5x, resources/image-set-4x.png 1600w"> | 51 <img id="x_and_w" sizes="700px" srcset="../../hidpi/resources/image-set-1x.p ng 0.5x, resources/image-set-4x.png 1600w"> |
52 <!-- The 'x' resource should be picked, and 'sizes' have no impact on its in trisic size --> | 52 <!-- The 'x' resource should be picked, and 'sizes' have no impact on its in trisic size --> |
53 <img id="x_and_w2" sizes="700px" srcset="../../hidpi/resources/image-set-2x. png 2x, resources/image-set-4x.png 16000w"> | 53 <img id="x_and_w2" sizes="700px" srcset="../../hidpi/resources/image-set-2x. png 2x, resources/image-set-4x.png 16000w"> |
54 <img id="x_and_w3" sizes="700px" srcset="resources/image-set-4x.png 16000w, ../../hidpi/resources/image-set-2x.png 2x"> | 54 <img id="x_and_w3" sizes="700px" srcset="resources/image-set-4x.png 16000w, ../../hidpi/resources/image-set-2x.png 2x"> |
55 <!-- The intrinsic size should be identical to the 'sizes' value --> | 55 <!-- The intrinsic size should be identical to the 'sizes' value --> |
56 <img id="half_size" sizes="50vw" srcset="../../hidpi/resources/image-set-2x. png 800w, resources/image-set-4x.png 16000w"> | 56 <img id="half_size" sizes="50vw" srcset="../../hidpi/resources/image-set-2x. png 800w, resources/image-set-4x.png 16000w"> |
57 <img id="infitisimal_sizes" sizes="1vw" srcset="../../hidpi/resources/image- set-2x.png 800w, resources/image-set-4x.png 16000w"> | 57 <img id="infitisimal_sizes" sizes="1vw" srcset="../../hidpi/resources/image- set-2x.png 800w, resources/image-set-4x.png 16000w"> |
58 </body> | 58 </body> |
59 </html> | 59 </html> |
OLD | NEW |