Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: third_party/WebKit/LayoutTests/fast/media/resolution-change-on-page-zoom.html

Issue 2038793002: Clear media query rulesets on page zoom changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use testharness.js Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698