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

Unified Diff: third_party/WebKit/LayoutTests/fast/media/mq-color-gamut-api.html

Issue 2652313004: Implement color-gamut media query (Closed)
Patch Set: fix windows build Created 3 years, 11 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
Index: third_party/WebKit/LayoutTests/fast/media/mq-color-gamut-api.html
diff --git a/third_party/WebKit/LayoutTests/fast/media/mq-color-gamut-api.html b/third_party/WebKit/LayoutTests/fast/media/mq-color-gamut-api.html
new file mode 100644
index 0000000000000000000000000000000000000000..dba13f75457472252b60eb10c1bbb576adc03524
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/media/mq-color-gamut-api.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Tests for color-gamut media query</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_true(window.matchMedia("(color-gamut)").matches);
+}, "Test that color-gamut can be feature detected");
+
+test(function() {
+ assert_false(window.matchMedia("(color-gamut: foobar)").matches);
+}, "Test that unknown values are rejected");
+
+async_test(t => {
+ assert_true('testRunner' in window);
+
+ testRunner.setColorProfile('sRGB', t.step_func(() => {
+ assert_true(window.matchMedia("(color-gamut: srgb)").matches);
+ assert_false(window.matchMedia("(color-gamut: p3)").matches);
+ assert_false(window.matchMedia("(color-gamut: rec2020)").matches);
+
+ testRunner.setColorProfile('colorSpin', t.step_func(() => {
+ assert_true(window.matchMedia("(color-gamut: srgb)").matches);
+ assert_false(window.matchMedia("(color-gamut: p3)").matches);
+ assert_false(window.matchMedia("(color-gamut: rec2020)").matches);
+
+ testRunner.setColorProfile('adobeRGB', t.step_func_done(() => {
+ assert_true(window.matchMedia("(color-gamut: srgb)").matches);
+ assert_true(window.matchMedia("(color-gamut: p3)").matches);
+ assert_false(window.matchMedia("(color-gamut: rec2020)").matches);
+ }));
+ }));
+ }));
+}, "Test API with various color profile");
+</script>

Powered by Google App Engine
This is Rietveld 408576698