Index: third_party/WebKit/LayoutTests/fast/media/resolution-change-on-page-zoom.html |
diff --git a/third_party/WebKit/LayoutTests/fast/media/resolution-change-on-page-zoom.html b/third_party/WebKit/LayoutTests/fast/media/resolution-change-on-page-zoom.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5a7f3c982947f8710c0971674cb4e66f4a36c030 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/media/resolution-change-on-page-zoom.html |
@@ -0,0 +1,29 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<style> |
+ @media (min-resolution: 2dppx) { |
+ body { background-color: green; } |
+ } |
+</style> |
+<p>The viewport should have a green background for page zoom = 200%.</p> |
+<script> |
+ setup({ "explicit_done": true }); |
+ |
+ matchMedia("(min-resolution: 2dppx)").addListener((mq) => { |
+ test(() => { |
+ assert_true(mq.matches, "resolution query doesn't match after page zoom."); |
+ }, "Check that the MediaQueryList matches the resolution query."); |
+ |
+ test(() => { |
+ assert_equals(getComputedStyle(document.body).backgroundColor, "rgb(0, 128, 0)", "Background color of body is not green."); |
+ }, "Check that the background color is applied after the media query result changed."); |
+ done(); |
+ }); |
+ |
+ onload = () => { |
+ document.body.offsetTop; |
+ if (window.eventSender) |
+ eventSender.setPageZoomFactor(2.0); |
+ }; |
+</script> |