Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
|
esprehn
2014/05/20 06:54:05
Missing doctype.
| |
| 2 <head> | |
|
esprehn
2014/05/20 06:54:05
We usually leave off <html>, <head> and <body>.
| |
| 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("simple").clientWidth', '800'); | |
| 12 shouldBe('document.getElementById("simple").currentSrc', '"../../hidpi/r esources/image-set-2x.png?2"'); | |
| 13 shouldBe('document.getElementById("multiple").clientWidth', '800'); | |
| 14 shouldBe('document.getElementById("multiple").currentSrc', '"../../hidpi /resources/image-set-2x.png?2"'); | |
| 15 shouldBe('document.getElementById("other_children").clientWidth', '800') ; | |
| 16 shouldBe('document.getElementById("other_children").currentSrc', '"../.. /hidpi/resources/image-set-2x.png?2"'); | |
| 17 shouldBe('document.getElementById("img_before_source").clientWidth', '75 '); | |
| 18 shouldBe('document.getElementById("img_before_source").currentSrc', '"re sources/blue_rect.jpg?1"'); | |
| 19 shouldBe('document.getElementById("unknown_type").clientWidth', '1600'); | |
| 20 shouldBe('document.getElementById("unknown_type").currentSrc', '"resourc es/image-set-4x.png?3"'); | |
| 21 shouldBe('document.getElementById("empty_srcset").clientWidth', '1600'); | |
| 22 shouldBe('document.getElementById("empty_srcset").currentSrc', '"resourc es/image-set-4x.png?3"'); | |
| 23 shouldBe('document.getElementById("no_srcset").clientWidth', '1600'); | |
| 24 shouldBe('document.getElementById("no_srcset").currentSrc', '"resources/ image-set-4x.png?3"'); | |
| 25 }, false); | |
| 26 </script> | |
| 27 </head> | |
| 28 | |
| 29 <body id="body"> | |
| 30 <!-- A canary image to see that the test is actually working --> | |
| 31 <img id="canary" src="resources/blue_rect.jpg?0"> | |
| 32 <!-- simple picture construct --> | |
| 33 <picture> | |
| 34 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/res ources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, | |
| 35 resources/image-set-4x.png?1 1600w"> | |
| 36 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/res ources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, | |
| 37 resources/image-set-4x.png?2 1600w"> | |
| 38 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/r esources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, | |
| 39 resources/image-set-4x.png?3 1600w"> | |
| 40 <img id="simple" src="resources/blue_rect.jpg?1"> | |
| 41 </picture> | |
| 42 <!-- Multiple img elements --> | |
| 43 <picture> | |
| 44 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/res ources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, | |
| 45 resources/image-set-4x.png?1 1600w"> | |
| 46 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/res ources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, | |
| 47 resources/image-set-4x.png?2 1600w"> | |
| 48 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/r esources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, | |
| 49 resources/image-set-4x.png?3 1600w"> | |
| 50 <img src="resources/blue_rect.jpg?1"> | |
| 51 <img id="multiple" src="resources/blue_rect.jpg?1"> | |
| 52 </picture> | |
| 53 <!-- non-source children - should be ignored--> | |
| 54 <picture> | |
| 55 <div>some text</div> | |
| 56 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/res ources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, | |
| 57 resources/image-set-4x.png?1 1600w"> | |
| 58 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/res ources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, | |
| 59 resources/image-set-4x.png?2 1600w"> | |
| 60 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/r esources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, | |
| 61 resources/image-set-4x.png?3 1600w"> | |
| 62 <img id="other_children" src="resources/blue_rect.jpg?1"> | |
| 63 </picture> | |
| 64 <!-- img before its source siblings - should ignore its siblings --> | |
| 65 <picture> | |
| 66 <img id="img_before_source" src="resources/blue_rect.jpg?1"> | |
| 67 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/res ources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, | |
| 68 resources/image-set-4x.png?1 1600w"> | |
| 69 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/res ources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, | |
| 70 resources/image-set-4x.png?2 1600w"> | |
| 71 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/r esources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, | |
| 72 resources/image-set-4x.png?3 1600w"> | |
| 73 </picture> | |
| 74 <!-- source with unknown type - should be ignored --> | |
| 75 <picture> | |
| 76 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/res ources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, | |
| 77 resources/image-set-4x.png?1 1600w"> | |
| 78 <source media="(max-width: 800px)" type="image/jp2" sizes="800px" srcset ="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set -2x.png?2 800w, | |
| 79 resources/image-set-4x.png?2 1600w"> | |
| 80 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/r esources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, | |
| 81 resources/image-set-4x.png?3 1600w"> | |
| 82 <img id="unknown_type" src="resources/blue_rect.jpg?1"> | |
| 83 </picture> | |
| 84 <!-- source with empty srcset - should be ignored --> | |
| 85 <picture> | |
| 86 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/res ources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, | |
| 87 resources/image-set-4x.png?1 1600w"> | |
| 88 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/res ources/image-set-1x.png?2 400r, ../../hidpi/resources/image-set-2x.png?2 800r, | |
| 89 resources/image-set-4x.png?2 1600r"> | |
| 90 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/r esources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, | |
| 91 resources/image-set-4x.png?3 1600w"> | |
| 92 <img id="empty_srcset" src="resources/blue_rect.jpg?1"> | |
| 93 </picture> | |
| 94 <!-- source with no srcset - should be ignored --> | |
| 95 <picture> | |
| 96 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/res ources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, | |
| 97 resources/image-set-4x.png?1 1600w"> | |
| 98 <source media="(max-width: 800px)" sizes="800px"> | |
| 99 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/r esources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, | |
| 100 resources/image-set-4x.png?3 1600w"> | |
| 101 <img id="no_srcset" src="resources/blue_rect.jpg?1"> | |
| 102 </picture> | |
| 103 </body> | |
| 104 </html> | |
| OLD | NEW |