|
| 1 | +<!DOCTYPE html> |
| 2 | +<meta charset='utf-8'> |
| 3 | +<title>navigator.windowControlsOverlay</title> |
| 4 | + |
| 5 | +<script src='/resources/testharness.js'></script> |
| 6 | +<script src='/resources/testharnessreport.js'></script> |
| 7 | + |
| 8 | +<script> |
| 9 | + test(function(){ |
| 10 | + assert_idl_attribute(navigator, 'windowControlsOverlay'); |
| 11 | + }, 'the windowControlsOverlay object should exist on the navigator object'); |
| 12 | + |
| 13 | + test(function(){ |
| 14 | + assert_idl_attribute(navigator.windowControlsOverlay, 'visible'); |
| 15 | + }, 'visible should be a member of the windowControlsOverlay object'); |
| 16 | + |
| 17 | + test(function(){ |
| 18 | + assert_false(navigator.windowControlsOverlay.visible); |
| 19 | + }, 'visible should be false'); |
| 20 | + |
| 21 | + test(function(){ |
| 22 | + assert_idl_attribute(navigator.windowControlsOverlay, 'getBoundingClientRect'); |
| 23 | + }, 'getBoundingClientRect should be a method of the windowControlsOverlay object'); |
| 24 | + |
| 25 | + test(function(){ |
| 26 | + var rect = navigator.windowControlsOverlay.getBoundingClientRect(); |
| 27 | + assert_true(rect instanceof DOMRect); |
| 28 | + }, 'getBoundingClientRect return type should be DOMRect'); |
| 29 | + |
| 30 | + test(function(){ |
| 31 | + var rect = navigator.windowControlsOverlay.getBoundingClientRect(); |
| 32 | + assert_equals(rect.x, 0); |
| 33 | + assert_equals(rect.y, 0); |
| 34 | + assert_equals(rect.width, 0); |
| 35 | + assert_equals(rect.height, 0); |
| 36 | + }, 'getBoundingClientRect should return a empty DOMRect'); |
| 37 | +</script> |
0 commit comments