Skip to content
Permalink
Browse files

Fugu: Use Display mojom and extend Screen interface for Screen Enumer…

…ation

Update code to better match the latest Screen Enumeration proposal:
https://github.com/spark008/screen-enumeration/blob/master/EXPLAINER.md

Use the existing Display mojo struct, instead of a new parallel struct.
Add [RuntimeEnabled=ScreenEnumeration] Screen attributes, instead of a new parallel object.
Rename requestDisplays to getScreens. Update test expectations.

Test with chrome://flags#enable-experimental-web-platform-features or --enable-blink-features=ScreenEnumeration

Bug: 994889
Test: Automated; getScreens() works with flag enabled.
Change-Id: I54f1594c5b6f1ad2a6532f3ee5f8a0184408c7b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1842339
Commit-Queue: Michael Wasserman <msw@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Staphany Park <staphany@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712839}
  • Loading branch information
Mike Wasserman authored and chromium-wpt-export-bot committed Nov 6, 2019
1 parent a772d5c commit 10d4cb65c022e89b0ddcf935b21cd6c35fdcf24a
@@ -0,0 +1,30 @@
// META: global=window,dedicatedworker,sharedworker,serviceworker
'use strict';

promise_test(async testCase => {
assert_class_string(navigator.screen, 'ScreenManager');
assert_equals(typeof navigator.screen.getScreens, 'function');
}, 'navigator.screen.getScreens is present');

promise_test(async testCase => {
const screens = await navigator.screen.getScreens();
assert_greater_than(screens.length, 0);

assert_equals(typeof screens[0].availWidth, 'number');
assert_equals(typeof screens[0].availHeight, 'number');
assert_equals(typeof screens[0].width, 'number');
assert_equals(typeof screens[0].height, 'number');
assert_equals(typeof screens[0].colorDepth, 'number');
assert_equals(typeof screens[0].pixelDepth, 'number');

assert_equals(typeof screens[0].availLeft, 'number');
assert_equals(typeof screens[0].availTop, 'number');
assert_equals(typeof screens[0].left, 'number');
assert_equals(typeof screens[0].top, 'number');
assert_equals(typeof screens[0].orientation, 'object');

assert_equals(typeof screens[0].primary, 'boolean');
assert_equals(typeof screens[0].internal, 'boolean');
assert_equals(typeof screens[0].scaleFactor, 'number');
assert_equals(typeof screens[0].name, 'string');
}, 'navigator.screen.getScreens returns at least 1 Screen');

This file was deleted.

0 comments on commit 10d4cb6

Please sign in to comment.
You can’t perform that action at this time.