Files
tubestation/testing/web-platform/tests/screen_enumeration
Ken Rockot edc98f091b Bug 1690075 [wpt PR 27429] - Migrate remaining WPT to Mojo JS modules, a=testonly
Automatic update from web-platform-tests
Migrate remaining WPT to Mojo JS modules

All remaining WPT using Mojo bindings are migrated to newer module-based
bindings here. Support for loading older bindings variants in WPT is
removed.

Bug: 1004256
Change-Id: I630a6ddb0e5b89f5b7e6c538a273c3725a485aae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2664907
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#849713}

--

wpt-commits: e3b2fa58ec722818ab212125275f89f3c8f40d32
wpt-pr: 27429
2021-02-08 22:55:28 +00:00
..

The screenenumeration-helpers.js requires an implementation of the ScreenEnumerationTest interfaces, which should emulate screen enumeration backends.

The ScreenEnumerationTest interface is defined as:

  class ScreenEnumerationTestChromium {
    initialize();  // Sets up the testing environment.
    async reset(); // Frees the resources.
    getMockScreenEnumeration(); // Returns `MockScreenEnumeration` interface.
  };

  class MockScreenEnumeration {
    reset(); Empties data of created mock displays.
    setInternalId(internalId); // Set internal screen ID.
    setPrimaryId(primaryId); // Set primary screen ID.
    setSuccess(success); // Set boolean to validate getDisplays() returned values.
    addDisplay(display); // Push display to the display vector.
    removeDisplay(id); // Remove display from the display vector.
    async getDisplays(); // Interceptor of getDisplays (screen_enumeration.mojom).
    async hasMultipleDisplays(); // Interceptor of hasMultipleDisplays (screen_enumeration.mojom).
  };

Other helper-functions are located in screenenumeration-helpers.js

makeDisplay(id, bounds, work_area, scale_factor); // Create display object.

The Chromium implementation of the ScreenEnumerationTest interface is located in mock-screenenumeration.js.

Other browser vendors should provide their own implementations of the ScreenEnumerationTest interfaces.