diff options
author | Moonchild <moonchild@palemoon.org> | 2021-02-04 19:41:06 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-02-04 19:41:06 +0000 |
commit | 914368530ba622ff0117cd34bec058fb0d862155 (patch) | |
tree | 6c29459914d1b01ed27fad039d0b982d1dbc32c3 /testing/web-platform/tests/battery-status | |
parent | c5ad76a2875ca5c06c5bbff7b2f2e3ff7b3599c3 (diff) | |
download | UXP-914368530ba622ff0117cd34bec058fb0d862155.tar UXP-914368530ba622ff0117cd34bec058fb0d862155.tar.gz UXP-914368530ba622ff0117cd34bec058fb0d862155.tar.lz UXP-914368530ba622ff0117cd34bec058fb0d862155.tar.xz UXP-914368530ba622ff0117cd34bec058fb0d862155.zip |
Issue #439 - Remove web-platform tests from the tree.
This removes a total of 23,936 files we would never use nor have the capacity
to properly maintain or keep up-to-date.
Diffstat (limited to 'testing/web-platform/tests/battery-status')
13 files changed, 0 insertions, 605 deletions
diff --git a/testing/web-platform/tests/battery-status/OWNERS b/testing/web-platform/tests/battery-status/OWNERS deleted file mode 100644 index eb86aa069..000000000 --- a/testing/web-platform/tests/battery-status/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -@anssiko -@dontcallmedom -@zqzhang diff --git a/testing/web-platform/tests/battery-status/battery-charging-manual.html b/testing/web-platform/tests/battery-status/battery-charging-manual.html deleted file mode 100644 index 8e80e30a2..000000000 --- a/testing/web-platform/tests/battery-status/battery-charging-manual.html +++ /dev/null @@ -1,52 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery Test: battery neither empty or full, charger plugged in</title> -<meta name="flags" content="interact"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<h2>Description</h2> -<p> - This test validates that all of the BatteryManager attributes exist and are set to their correct values when battery is charging. -</p> - -<h2>Preconditions</h2> -<ol> - <li> - The device is plugged in to the charger before this test is run. - </li> - <li> - The battery must neither be empty or full, nor reach empty or full capacity during the test. - </li> - <li> - Waiting for battery level change to fire levelchange event, maybe need a long time - </li> -</ol> - -<script> - -setup({ explicit_timeout: true }); - -async_test(function (t) { - navigator.getBattery().then(function (battery) { - t.step(function () { - assert_true(battery.charging, 'charging must be set to true'); - assert_equals(battery.dischargingTime, Infinity, 'dischargingTime must be set to Infinity'); - assert_greater_than(battery.level, 0, 'level must be greater than 0'); - assert_less_than_equal(battery.level, 1.0, 'level must be less than or equal to 1.0'); - - var battery_level = battery.level; - battery.onlevelchange = t.step_func(function () { - assert_greater_than(battery.level, battery_level, 'The value of the level attribute must increase'); - t.done(); - }); - }); - }, function (error) { - t.step(function () { - assert_unreached(error.message); - }); - t.done(); - }); -}, document.title); - -</script> diff --git a/testing/web-platform/tests/battery-status/battery-discharging-manual.html b/testing/web-platform/tests/battery-status/battery-discharging-manual.html deleted file mode 100644 index c4ccbe445..000000000 --- a/testing/web-platform/tests/battery-status/battery-discharging-manual.html +++ /dev/null @@ -1,52 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery Test: battery neither empty or full, charger unplugged in</title> -<meta name="flags" content="interact"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<h2>Description</h2> -<p> - This test validates that all of the BatteryManager attributes exist and are set to their correct values when battery is discharging. -</p> - -<h2>Preconditions</h2> -<ol> - <li> - The device is unplugged from the charger before this test is run. - </li> - <li> - The battery must neither be empty or full, nor reach empty or full capacity during the test. - </li> - <li> - Waiting for battery level change to fire levelchange event, maybe need a long time - </li> -</ol> - -<script> - -setup({ explicit_timeout: true }); - -async_test(function (t) { - navigator.getBattery().then(function (battery) { - t.step(function () { - assert_false(battery.charging, 'charging must be set to false'); - assert_equals(battery.chargingTime, Infinity, 'chargingTime must be set to Infinity'); - assert_greater_than(battery.level, 0, 'level must be greater than 0'); - assert_less_than_equal(battery.level, 1.0, 'level must be less than or equal to 1.0'); - - var battery_level = battery.level; - battery.onlevelchange = t.step_func(function () { - assert_less_than(battery.level, battery_level, 'The value of the level attribute must decrease'); - t.done(); - }); - }); - }, function (error) { - t.step(function () { - assert_unreached(error.message); - }); - t.done(); - }); -}, document.title); - -</script> diff --git a/testing/web-platform/tests/battery-status/battery-full-manual.html b/testing/web-platform/tests/battery-status/battery-full-manual.html deleted file mode 100644 index 883d71f40..000000000 --- a/testing/web-platform/tests/battery-status/battery-full-manual.html +++ /dev/null @@ -1,42 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery Test: battery full, charger plugged in</title> -<meta name="flags" content="interact"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<h2>Description</h2> -<p> - This test validates that all of the BatteryManager attributes exist and are set to their correct values when battery is full. -</p> - -<h2>Preconditions</h2> -<ol> - <li> - The device is plugged in to the charger before this test is run. - </li> - <li> - The battery is full. - </li> -</ol> - -<script> - -async_test(function (t) { - navigator.getBattery().then(function (battery) { - t.step(function () { - assert_true(battery.charging, 'charging must be set to true'); - assert_equals(battery.chargingTime, 0, 'chargingTime must be set to 0'); - assert_equals(battery.dischargingTime, Infinity, 'dischargingTime must be set to Infinity'); - assert_equals(battery.level, 1.0, 'level must be set to 1.0'); - }); - t.done(); - }, function (error) { - t.step(function () { - assert_unreached(error.message); - }); - t.done(); - }); -}, document.title); - -</script> diff --git a/testing/web-platform/tests/battery-status/battery-interface-idlharness.html b/testing/web-platform/tests/battery-status/battery-interface-idlharness.html deleted file mode 100644 index 4e9b209d4..000000000 --- a/testing/web-platform/tests/battery-status/battery-interface-idlharness.html +++ /dev/null @@ -1,74 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery test: IDL</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/WebIDLParser.js"></script> -<script src="/resources/idlharness.js"></script> -<script type="text/plain" class="untested"> -interface Navigator { }; - -interface EventTarget { - void addEventListener(DOMString type, EventListener? callback, optional boolean capture); - void removeEventListener(DOMString type, EventListener? callback, optional boolean capture); - boolean dispatchEvent(Event event); -}; - -[Callback] -interface EventListener { - void handleEvent(Event event); -}; -[TreatNonObjectAsNull] -callback EventHandlerNonNull = any (Event event); -typedef EventHandlerNonNull? EventHandler; -</script> -<script type="text/plain"> -partial interface Navigator { - Promise<BatteryManager> getBattery (); -}; - -interface BatteryManager : EventTarget { - readonly attribute boolean charging; - readonly attribute unrestricted double chargingTime; - readonly attribute unrestricted double dischargingTime; - readonly attribute double level; - attribute EventHandler onchargingchange; - attribute EventHandler onchargingtimechange; - attribute EventHandler ondischargingtimechange; - attribute EventHandler onlevelchange; -}; -</script> -<script> -"use strict"; -var t = async_test(); -var idl_array = new IdlArray(); -var idls; -var manager; -[].forEach.call(document.querySelectorAll('script[type=text\\/plain]'), function(node) { - idls = node.textContent; - idl_array[(node.className === 'untested') ? 'add_untested_idls' : 'add_idls'](idls); -}); -t.step(function() { - assert_idl_attribute(navigator, 'getBattery', 'navigator must have getBattery attribute'); - navigator.getBattery().then(function(bm) { - manager = bm; - idl_array.add_objects({Navigator: ['navigator'], BatteryManager: ['manager']}); - idl_array.test(); - t.done(); - }).catch(function(err) { - t.assert_unreached("navigator.getBattery failed"); - }); -}); -</script> - -<h2>Description</h2> -<p> - This test validates the BatteryManager interface IDL. -</p> -<p> - This test uses <a href="/resources/idlharness.js">idlharness.js</a>, and - is complementary to the <a href="battery-interface.html">battery-interface.html</a> - test. -</p> - -<div id="log"></div> diff --git a/testing/web-platform/tests/battery-status/battery-plugging-in-manual.html b/testing/web-platform/tests/battery-status/battery-plugging-in-manual.html deleted file mode 100644 index 4d16cf187..000000000 --- a/testing/web-platform/tests/battery-status/battery-plugging-in-manual.html +++ /dev/null @@ -1,125 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery Test: battery not full, charger plugging in</title> -<meta name="flags" content="interact"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<style> - #note { - background-color: #fef1b5; - border: solid 1px #cdab2d; - padding: 5px; - margin: 15px; - display: block; - } -</style> - -<h2>Description</h2> -<p> - This test validates that all of the BatteryManager attributes exist and - are set to correct values, with corresponding events fired, - when the charger is plugged in. -</p> - -<h2>Preconditions</h2> -<ol> - <li> - The device is unplugged from the charger before this test is run. - </li> - <li> - The battery must not be full or reach full capacity before the time the test is run. - </li> -</ol> - -<div id="note"> - <ol> - <li> - Plug in the charger and wait for all the tests to complete. - </li> - <li> - The tests may take long time since the definition of how - often the chargingtimechange, dischargingtimechange, and levelchange - events are fired is left to the implementation. - </li> - </ol> -</div> - -<div id="log"></div> - -<script> - -(function() { - - setup({ explicit_timeout: true }); - - var onchargingchange_test = async_test( - 'When the device is plugged in and its charging state is updated, ' + - 'must set the charging attribute\'s value to true and ' + - 'fire a chargingchange event.'); - var onchargingtimechange_test = async_test( - 'When the device is plugged in and its charging time is updated, ' + - 'must set the chargingTime attribute\'s value and fire ' + - 'a chargingtimechange event.'); - var ondischargingtimechange_test = async_test( - 'When the device is plugged in and its discharging time is updated, ' + - 'must set the dischargingTime attribute\'s value to Infinity and ' + - 'fire a dischargingtimechange event.'); - var onlevelchange_test = async_test( - 'When the device is plugged in and the battery level is updated, ' + - 'must set the level attribute\'s value and fire a levelchange event.'); - - var batterySuccess = function (battery) { - battery.onchargingchange = onchargingchange_test.step_func(function () { - assert_true(battery.charging, 'The charging attribute must be set to true.'); - onchargingchange_test.done(); - }); - - var battery_chargingtime = battery.chargingTime; - battery.onchargingtimechange = onchargingtimechange_test.step_func(function () { - assert_less_than(battery.chargingTime, battery_chargingtime, - 'The value of the chargingTime attribute must decrease.'); - onchargingtimechange_test.done(); - }); - - battery.ondischargingtimechange = ondischargingtimechange_test.step_func(function () { - if (battery.charging) { - assert_equals(battery.dischargingTime, Infinity, - 'The value of the dischargingTime attribute must be set to Infinity.'); - ondischargingtimechange_test.done(); - } - }); - - battery.onlevelchange = onlevelchange_test.step_func(function () { - assert_greater_than(battery.level, 0); - assert_less_than_equal(battery.level, 1.0); - onlevelchange_test.done(); - }); - }; - - var batteryFailure = function (error) { - onchargingchange_test.step(function () { - assert_unreached(error.message); - }); - onchargingchange_test.done(); - - onchargingtimechange_test.step(function () { - assert_unreached(error.message); - }); - onchargingtimechange_test.done(); - - ondischargingtimechange_test.step(function () { - assert_unreached(error.message); - }); - ondischargingtimechange_test.done(); - - onlevelchange_test.step(function () { - assert_unreached(error.message); - }); - onlevelchange_test.done(); - }; - - navigator.getBattery().then(batterySuccess, batteryFailure); - -})(); - -</script> diff --git a/testing/web-platform/tests/battery-status/battery-promise-iframe.html b/testing/web-platform/tests/battery-status/battery-promise-iframe.html deleted file mode 100644 index 6add86106..000000000 --- a/testing/web-platform/tests/battery-status/battery-promise-iframe.html +++ /dev/null @@ -1,80 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery Test: iframe has a different Navigator object</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<style> - iframe { - display: none; - } -</style> -<div id="log"></div> -<iframe id="blank" src="about:blank"></iframe> -<iframe id="frame"></iframe> -<script> -promise_test(function(t) { - var iframe = document.querySelector('#blank'); - var originalPromise = navigator.getBattery(); - - return originalPromise.then(function(originalManager) { - var promise = iframe.contentWindow.navigator.getBattery(); - - assert_true(originalManager instanceof BatteryManager); - assert_not_equals(iframe.contentWindow.navigator, - navigator, - 'navigator objects shall be different'); - assert_not_equals(promise, - originalPromise, - 'battery promises in different navigators shall be different'); - assert_equals(iframe.contentWindow.navigator.getBattery(), - promise, - 'battery promises in same navigator shall be same'); - - return promise; - }).then(function(manager) { - assert_equals(manager.__proto__, - iframe.contentWindow.BatteryManager.prototype); - assert_true(manager instanceof iframe.contentWindow.BatteryManager); - }); - -}, 'iframe has a different Navigator object thus getting another battery promise'); - -async_test(function (t) { - var iframe = document.querySelector('#blank'); - var originalNavigator = iframe.contentWindow.navigator; - var originalPromise = iframe.contentWindow.navigator.getBattery(); - - iframe.onload = t.step_func(function() { - assert_equals(iframe.contentWindow.navigator, - originalNavigator, - 'navigator objects shall be same'); - assert_equals(iframe.contentWindow.navigator.getBattery(), - originalPromise, - 'battery status promises shall be same'); - t.done(); - }); - - iframe.src = 'support-iframe.html'; -}, 'setting src of an iframe with initial about:blank makes same Navigator object and battery promise'); - -async_test(function (t) { - var iframe = document.querySelector('#frame'); - iframe.src = 'support-iframe-initial.html'; - iframe.onload = t.step_func(function() { - var originalNavigator = iframe.contentWindow.navigator; - var originalPromise = iframe.contentWindow.navigator.getBattery(); - - iframe.onload = t.step_func(function() { - assert_not_equals(iframe.contentWindow.navigator, - originalNavigator, - 'navigator objects shall be changed'); - assert_not_equals(iframe.contentWindow.navigator.getBattery(), - originalPromise, - 'battery status promises shall be different'); - t.done(); - }); - - iframe.src = 'support-iframe.html'; - }); -}, 'setting src of an iframe with initial frame makes its Navigator object vary thus getting another battery promise'); -</script> diff --git a/testing/web-platform/tests/battery-status/battery-promise-window.html b/testing/web-platform/tests/battery-status/battery-promise-window.html deleted file mode 100644 index a7d708c05..000000000 --- a/testing/web-platform/tests/battery-status/battery-promise-window.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery Test: window.open() makes a different Navigator object</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<style> - #note { - background-color: #fef1b5; - border: solid 1px #cdab2d; - padding: 5px; - margin: 15px; - display: block; - } -</style> -<div id="note"> - Allow pop-up windows before running the tests. -</div> -<div id="log"></div> -<script> -async_test(function (t) { - var win = window.open('support-window-open.html'); - window.onmessage = t.step_func(function(e) { - assert_array_equals(e.data, [false, false, true]); - win.close(); - t.done(); - }); -}, 'window.open() makes a different Navigator object thus getting another battery promise'); -</script> diff --git a/testing/web-platform/tests/battery-status/battery-promise.html b/testing/web-platform/tests/battery-status/battery-promise.html deleted file mode 100644 index 8c552eb3f..000000000 --- a/testing/web-platform/tests/battery-status/battery-promise.html +++ /dev/null @@ -1,19 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery Test: navigator.getBattery() always return same battery promise</title> -<link rel="author" title="YuichiNukiyama" href="https://github.com/YuichiNukiyama"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<div id="log"></div> -<script> -promise_test(function () { - return navigator.getBattery().then(function (result) { - assert_class_string(result, 'BatteryManager', - 'getBattery should return BatteryManager Object.'); - }); -}, 'navigator.getBattery() shall return BatteryManager as a promise'); - -test(function () { - assert_equals(navigator.getBattery(), navigator.getBattery()); -}, 'navigator.getBattery() shall always return the same promise'); -</script> diff --git a/testing/web-platform/tests/battery-status/battery-unplugging-manual.html b/testing/web-platform/tests/battery-status/battery-unplugging-manual.html deleted file mode 100644 index bb576da2b..000000000 --- a/testing/web-platform/tests/battery-status/battery-unplugging-manual.html +++ /dev/null @@ -1,110 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Battery Test: charger unplugging</title> -<meta name="flags" content="interact"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<style> - #note { - background-color: #fef1b5; - border: solid 1px #cdab2d; - padding: 5px; - margin: 15px; - display: block; - } -</style> - -<h2>Description</h2> -<p> - This test validates that all of the BatteryManager attributes exist and - are set to correct values, with corresponding events fired, - when the charger is unplugged. -</p> - -<h2>Preconditions</h2> -<ol> - <li> - The device is plugged in to the charger before this test is run. - </li> -</ol> - -<div id="note"> - Unplug the charger and wait for all the tests to complete. -</div> - -<div id="log"></div> - -<script> - -(function() { - - setup({ explicit_timeout: true }); - - var onchargingchange_test = async_test( - 'When the device is unplugged in and its charging state is updated, ' + - 'must set the charging attribute\'s value to false and ' + - 'fire a chargingchange event.'); - var onchargingtimechange_test = async_test( - 'When the device is unplugged in and its charging time is updated, ' + - 'must set the chargingTime attribute\'s value to Infinity and ' + - 'fire a chargingtimechange event.'); - var ondischargingtimechange_test = async_test( - 'When the device is unplugged in and its discharging time is updated, ' + - 'must set the dischargingTime attribute\'s value and ' + - 'fire a dischargingtimechange event.'); - var onlevelchange_test = async_test( - 'When the device is unplugged in and the battery level is updated, ' + - 'must set the level attribute\'s value and fire a levelchange event.'); - - var batterySuccess = function (battery) { - battery.onchargingchange = onchargingchange_test.step_func(function () { - assert_false(battery.charging, 'The charging attribute must be set to false.'); - onchargingchange_test.done(); - }); - - battery.onchargingtimechange = onchargingtimechange_test.step_func(function () { - assert_equals(battery.chargingTime, Infinity, - 'The value of the chargingTime attribute must be set to Infinity.'); - onchargingtimechange_test.done(); - }); - - battery.ondischargingtimechange = ondischargingtimechange_test.step_func(function () { - assert_less_than(battery.dischargingTime, Infinity, - 'The value of the dischargingTime attribute must be set to the remaining discharging time.'); - ondischargingtimechange_test.done(); - }); - - battery.onlevelchange = onlevelchange_test.step_func(function () { - assert_greater_than(battery.level, 0); - assert_less_than_equal(battery.level, 1.0); - onlevelchange_test.done(); - }); - }; - - var batteryFailure = function (error) { - onchargingchange_test.step(function () { - assert_unreached(error.message); - }); - onchargingchange_test.done(); - - onchargingtimechange_test.step(function () { - assert_unreached(error.message); - }); - onchargingtimechange_test.done(); - - ondischargingtimechange_test.step(function () { - assert_unreached(error.message); - }); - ondischargingtimechange_test.done(); - - onlevelchange_test.step(function () { - assert_unreached(error.message); - }); - onlevelchange_test.done(); - }; - - navigator.getBattery().then(batterySuccess, batteryFailure); - -})(); - -</script> diff --git a/testing/web-platform/tests/battery-status/support-iframe-initial.html b/testing/web-platform/tests/battery-status/support-iframe-initial.html deleted file mode 100644 index d4e5b31f1..000000000 --- a/testing/web-platform/tests/battery-status/support-iframe-initial.html +++ /dev/null @@ -1,5 +0,0 @@ -<!DOCTYPE HTML> -<meta charset="utf-8"> -<div> -Hello! -</div> diff --git a/testing/web-platform/tests/battery-status/support-iframe.html b/testing/web-platform/tests/battery-status/support-iframe.html deleted file mode 100644 index d4e5b31f1..000000000 --- a/testing/web-platform/tests/battery-status/support-iframe.html +++ /dev/null @@ -1,5 +0,0 @@ -<!DOCTYPE HTML> -<meta charset="utf-8"> -<div> -Hello! -</div> diff --git a/testing/web-platform/tests/battery-status/support-window-open.html b/testing/web-platform/tests/battery-status/support-window-open.html deleted file mode 100644 index afffc3af2..000000000 --- a/testing/web-platform/tests/battery-status/support-window-open.html +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE HTML> -<meta charset="utf-8"> -<script> -var data = [ - navigator === window.opener.navigator, - navigator.getBattery() === window.opener.navigator.getBattery(), - navigator.getBattery() === navigator.getBattery() -]; -window.opener.postMessage(data, '*'); -</script> |