servo/tests/wpt/web-platform-tests/screen_enumeration
2020-05-30 10:56:10 +00:00
..
resources Update web-platform-tests to revision 8fd32a0f7c18d32ae9e147d267746accc3ee9ad5 2020-05-30 10:56:10 +00:00
getScreens.tentative.https.window.js Update web-platform-tests to revision 8fd32a0f7c18d32ae9e147d267746accc3ee9ad5 2020-05-30 10:56:10 +00:00
getScreens.values.https.html Update web-platform-tests to revision 8fd32a0f7c18d32ae9e147d267746accc3ee9ad5 2020-05-30 10:56:10 +00:00
README.md Update web-platform-tests to revision 8fd32a0f7c18d32ae9e147d267746accc3ee9ad5 2020-05-30 10:56:10 +00:00
screen_enumeration_permission.window.js Update web-platform-tests to revision 8fd32a0f7c18d32ae9e147d267746accc3ee9ad5 2020-05-30 10:56:10 +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.
    setId(internalId, primaryId); // Set primary screen and internal screen IDs.
    setSuccess(success); // Set boolean to validate getDisplays() returned values.
    addDisplay(display); // Push display to the display vector.
    async getDisplays(); // Interceptor of getDisplays (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.