| <!DOCTYPE html> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script>let additionalChromiumResources = ["resources/xr-internal-device-mocking.js"];</script> |
| <script src="/webxr/resources/webxr_util.js"></script> |
| <script src="/webxr/resources/webxr_test_constants.js"></script> |
| <script src="/webxr/resources/webxr_test_asserts.js"></script> |
| <canvas /> |
| |
| <script> |
| // Because AR is not yet in the core webxr spec, this is an internal-chrome only test. |
| let testName = "Ensures DOM Overlay feature works for immersive-ar"; |
| |
| let fakeDeviceInitParams = { supportsImmersive: true, |
| views: VALID_VIEWS, |
| supportsEnvironmentIntegration: true, |
| supportedFeatures: ALL_FEATURES.concat([ |
| 'dom-overlay-for-handheld-ar'])}; |
| |
| let testFunction = function(session, fakeDeviceController, t) { |
| assert_equals(session.mode, 'immersive-ar'); |
| assert_not_equals(session.environmentBlendMode, 'opaque'); |
| |
| // The <body> element should have a transparent background. |
| assert_equals(window.getComputedStyle(document.body).backgroundColor, |
| 'rgba(0, 0, 0, 0)'); |
| |
| // Try fullscreening an element. |
| let elem = document.querySelector('canvas'); |
| return elem.requestFullscreen().then(() => { |
| assert_equals(document.fullscreenElement, elem); |
| }); |
| }; |
| |
| xr_session_promise_test( |
| testName, testFunction, fakeDeviceInitParams, 'immersive-ar', |
| {requiredFeatures: ['dom-overlay-for-handheld-ar']}); |
| |
| </script> |