summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.html
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-02-25 01:03:57 +0000
committerMoonchild <moonchild@palemoon.org>2021-02-25 01:03:57 +0000
commitceadffab6b357723981a429e11222daf6cd6dcfb (patch)
tree5603053048d6a460f79b22bdf165fb74d32d39b0 /testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.html
parent14fb2f966e9b54598c451e3cb35b4aa0480dafed (diff)
parentad5a13bd501e379517da1a944c104a11d951a3f5 (diff)
downloadUXP-RC_20210225.tar
UXP-RC_20210225.tar.gz
UXP-RC_20210225.tar.lz
UXP-RC_20210225.tar.xz
UXP-RC_20210225.zip
Merge branch 'master' into releaseRC_20210225
Diffstat (limited to 'testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.html')
-rw-r--r--testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.html83
1 files changed, 0 insertions, 83 deletions
diff --git a/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.html b/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.html
deleted file mode 100644
index de6ca2b74..000000000
--- a/testing/web-platform/tests/presentation-api/controlling-ua/getAvailability.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html>
-<meta charset="utf-8">
-<title>Presentation API - monitor screen availability tests for Controlling User Agent</title>
-<link rel="author" title="Marius Wessel" href="http://www.fokus.fraunhofer.de">
-<link rel="help" href="http://w3c.github.io/presentation-api/#dfn-controlling-user-agent">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-
-<script>
- // ---------------------------------
- // Helper Function
- // ---------------------------------
- var createRequestObject = function () {
- var validUnixDate = new Date().getTime() + String(Math.floor(Math.random() * 1e5)),
- presUrl = "../receiving-ua/idlharness.html#__castAppId__=2334D33A/__castClientId__=" + validUnixDate,
- request = new PresentationRequest(presUrl);
- return request;
- }
-
- // ---------------------------------
- // Screen Availability Tests - begin
- // ---------------------------------
-
- // Instance of Promise Test
- test(function () {
- var request = createRequestObject();
- assert_true(request.getAvailability() instanceof Promise);
- }, 'The request is an Promise.')
-
- // Instance of PresentationRequest Test
- test(function () {
- var request = createRequestObject();
- assert_true(request instanceof PresentationRequest);
- }, 'The request is an instance of PresentationRequest.')
-
- // Instance of PresentationAvailability Test
- promise_test(function () {
- var request = createRequestObject();
-
- return request.getAvailability()
- .then(function (availability) {
- assert_true(availability instanceof PresentationAvailability);
- });
- }, "The promise is an instance of PresentationAvailability");
-
- // Availability.value is set Test
- promise_test(function () {
- var request = createRequestObject();
-
- return request.getAvailability()
- .then(function (availability) {
- assert_true(typeof availability.value == 'boolean');
- });
- }, "The availability has an boolean value.");
-
-
- // Best Case Scenario Test
- // -----------------------
- promise_test(function () {
- var request = createRequestObject();
-
- return request.getAvailability()
- .then(function (availability) {
- assert_true(availability.value);
- });
- }, "There is an availability.");
-
-
- // Invalid Presentation URL Test
- promise_test(function () {
- var validUnixDate = new Date().getTime() + String(Math.floor(Math.random() * 1e5)),
- invalidPresUrl = "../receiving-ua/idlharness.html#__castAppId__=3445E44B/__castClientId__=" + validUnixDate,
- request = new PresentationRequest(invalidPresUrl);
-
- return request.getAvailability()
- .then(function (availability) {
- assert_false(availability.value);
- });
- }, "There is no availability for an invalid presentation URL.");
- // -------------------------------
- // Screen Availability Tests - end
- // -------------------------------
-</script>