Chromium Code Reviews| Index: LayoutTests/fast/dom/HTMLImageElement/image-picture-1x.html |
| diff --git a/LayoutTests/fast/dom/HTMLImageElement/image-picture-1x.html b/LayoutTests/fast/dom/HTMLImageElement/image-picture-1x.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f639995bd8afac16e0827502ed0c7d3601c3638c |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/HTMLImageElement/image-picture-1x.html |
| @@ -0,0 +1,104 @@ |
| +<html> |
|
esprehn
2014/05/20 06:54:05
Missing doctype.
|
| +<head> |
|
esprehn
2014/05/20 06:54:05
We usually leave off <html>, <head> and <body>.
|
| +<script src="../../../resources/js-test.js"></script> |
| +<script> |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + |
| + addEventListener("load", function() { |
| + shouldBe('document.getElementById("canary").clientWidth', '75'); |
| + shouldBe('document.getElementById("canary").currentSrc', '"resources/blue_rect.jpg?0"'); |
| + shouldBe('document.getElementById("simple").clientWidth', '800'); |
| + shouldBe('document.getElementById("simple").currentSrc', '"../../hidpi/resources/image-set-2x.png?2"'); |
| + shouldBe('document.getElementById("multiple").clientWidth', '800'); |
| + shouldBe('document.getElementById("multiple").currentSrc', '"../../hidpi/resources/image-set-2x.png?2"'); |
| + shouldBe('document.getElementById("other_children").clientWidth', '800'); |
| + shouldBe('document.getElementById("other_children").currentSrc', '"../../hidpi/resources/image-set-2x.png?2"'); |
| + shouldBe('document.getElementById("img_before_source").clientWidth', '75'); |
| + shouldBe('document.getElementById("img_before_source").currentSrc', '"resources/blue_rect.jpg?1"'); |
| + shouldBe('document.getElementById("unknown_type").clientWidth', '1600'); |
| + shouldBe('document.getElementById("unknown_type").currentSrc', '"resources/image-set-4x.png?3"'); |
| + shouldBe('document.getElementById("empty_srcset").clientWidth', '1600'); |
| + shouldBe('document.getElementById("empty_srcset").currentSrc', '"resources/image-set-4x.png?3"'); |
| + shouldBe('document.getElementById("no_srcset").clientWidth', '1600'); |
| + shouldBe('document.getElementById("no_srcset").currentSrc', '"resources/image-set-4x.png?3"'); |
| + }, false); |
| +</script> |
| +</head> |
| + |
| +<body id="body"> |
| + <!-- A canary image to see that the test is actually working --> |
| + <img id="canary" src="resources/blue_rect.jpg?0"> |
| + <!-- simple picture construct --> |
| + <picture> |
| + <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| + resources/image-set-4x.png?1 1600w"> |
| + <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| + resources/image-set-4x.png?2 1600w"> |
| + <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| + resources/image-set-4x.png?3 1600w"> |
| + <img id="simple" src="resources/blue_rect.jpg?1"> |
| + </picture> |
| + <!-- Multiple img elements --> |
| + <picture> |
| + <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| + resources/image-set-4x.png?1 1600w"> |
| + <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| + resources/image-set-4x.png?2 1600w"> |
| + <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| + resources/image-set-4x.png?3 1600w"> |
| + <img src="resources/blue_rect.jpg?1"> |
| + <img id="multiple" src="resources/blue_rect.jpg?1"> |
| + </picture> |
| + <!-- non-source children - should be ignored--> |
| + <picture> |
| + <div>some text</div> |
| + <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| + resources/image-set-4x.png?1 1600w"> |
| + <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| + resources/image-set-4x.png?2 1600w"> |
| + <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| + resources/image-set-4x.png?3 1600w"> |
| + <img id="other_children" src="resources/blue_rect.jpg?1"> |
| + </picture> |
| + <!-- img before its source siblings - should ignore its siblings --> |
| + <picture> |
| + <img id="img_before_source" src="resources/blue_rect.jpg?1"> |
| + <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| + resources/image-set-4x.png?1 1600w"> |
| + <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| + resources/image-set-4x.png?2 1600w"> |
| + <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| + resources/image-set-4x.png?3 1600w"> |
| + </picture> |
| + <!-- source with unknown type - should be ignored --> |
| + <picture> |
| + <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| + resources/image-set-4x.png?1 1600w"> |
| + <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, |
| + resources/image-set-4x.png?2 1600w"> |
| + <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| + resources/image-set-4x.png?3 1600w"> |
| + <img id="unknown_type" src="resources/blue_rect.jpg?1"> |
| + </picture> |
| + <!-- source with empty srcset - should be ignored --> |
| + <picture> |
| + <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| + resources/image-set-4x.png?1 1600w"> |
| + <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400r, ../../hidpi/resources/image-set-2x.png?2 800r, |
| + resources/image-set-4x.png?2 1600r"> |
| + <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| + resources/image-set-4x.png?3 1600w"> |
| + <img id="empty_srcset" src="resources/blue_rect.jpg?1"> |
| + </picture> |
| + <!-- source with no srcset - should be ignored --> |
| + <picture> |
| + <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resources/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| + resources/image-set-4x.png?1 1600w"> |
| + <source media="(max-width: 800px)" sizes="800px"> |
| + <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resources/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| + resources/image-set-4x.png?3 1600w"> |
| + <img id="no_srcset" src="resources/blue_rect.jpg?1"> |
| + </picture> |
| +</body> |
| +</html> |