Skip to content

Commit cdb3f13

Browse files
committed
Bug 1678394 [wpt PR 26577] - dpwas: Add object to Window Controls Overlay (WCO) Javascript API, a=testonly
Automatic update from web-platform-tests dpwas: Add object to Window Controls Overlay (WCO) Javascript API This CL adds windowControlsOverlay object to the window.navigator API. The changes are behind the flag: "WebAppWindowControlsOverlay" Explainer: https://github.com/WICG/window-controls-overlay/blob/master/explainer.md Design Doc: https://docs.google.com/document/d/1k0YL_-VMLIfjYCgJ2v6cMvuUv2qMKg4BgLI2tJ4qtyo/edit?usp=sharing I2P: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/cper6nNLFRQ/hU91kfCWBQAJ Bug: 937121 Change-Id: Iabe3ff49ab4948e3aa225fb2764f6975c890bddf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2549120 Reviewed-by: Chase Phillips <cmpchromium.org> Reviewed-by: Kentaro Hara <harakenchromium.org> Commit-Queue: Hassan Talat <hatalatmicrosoft.com> Cr-Commit-Position: refs/heads/master{#832180} -- wpt-commits: 5c5e2f05d347c92bb9d4676429bb590a9dde029d wpt-pr: 26577 UltraBlame original commit: 3733fe33c543bd04b472a93657f67a88e792356b
1 parent be7a9aa commit cdb3f13

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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

Comments
 (0)