OLD | NEW |
(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> |
OLD | NEW |