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

Side by Side 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, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Tests for color-gamut media query</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6 test(function() {
7 assert_true(window.matchMedia("(color-gamut)").matches);
8 }, "Test that color-gamut can be feature detected");
9
10 test(function() {
11 assert_false(window.matchMedia("(color-gamut: foobar)").matches);
12 }, "Test that unknown values are rejected");
13
14 async_test(t => {
15 assert_true('testRunner' in window);
16
17 testRunner.setColorProfile('sRGB', t.step_func(() => {
18 assert_true(window.matchMedia("(color-gamut: srgb)").matches);
19 assert_false(window.matchMedia("(color-gamut: p3)").matches);
20 assert_false(window.matchMedia("(color-gamut: rec2020)").matches);
21
22 testRunner.setColorProfile('colorSpin', t.step_func(() => {
23 assert_true(window.matchMedia("(color-gamut: srgb)").matches);
24 assert_false(window.matchMedia("(color-gamut: p3)").matches);
25 assert_false(window.matchMedia("(color-gamut: rec2020)").matches);
26
27 testRunner.setColorProfile('adobeRGB', t.step_func_done(() => {
28 assert_true(window.matchMedia("(color-gamut: srgb)").matches);
29 assert_true(window.matchMedia("(color-gamut: p3)").matches);
30 assert_false(window.matchMedia("(color-gamut: rec2020)").matches);
31 }));
32 }));
33 }));
34 }, "Test API with various color profile");
35 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698