Bug 1471813 [wpt PR 11704] - Wake Lock API: Implement Screen WakeLock based on Promises., a=testonly
authorMrunal Kapade <mrunal.kapade@intel.com>
Wed, 22 Aug 2018 13:20:34 +0000
changeset 433106 c20e7de28c1e4e6cea625478a4b67e1ca84e87ee
parent 433105 4b4863b6778762764d7d8f9b4cb37f946019d800
child 433107 3b8c694e236d187cdee3049fea01f0551dd0b4ac
push id34499
push usercsabou@mozilla.com
push dateThu, 23 Aug 2018 21:40:51 +0000
treeherdermozilla-central@49b70f7e6817 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1471813, 11704, 257511, 918062, 584239
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1471813 [wpt PR 11704] - Wake Lock API: Implement Screen WakeLock based on Promises., a=testonly Automatic update from web-platform-testsWake Lock API: Implement Screen WakeLock based on Promises. This patch implements navigator.getWakeLock(WakeLockType) and other necessary interfaces such as WakeLock and WakeLockRequest to provide acesss to Screen wakelock for now. Latest WakeLock API spec can be seen here, https://www.w3.org/TR/wake-lock. Intent to Implement, https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/KMNZmMF1_H4 Bug: 257511 Change-Id: I7fa4d0f7f287d7497b48f583e18e0ca5ca39e662 Reviewed-on: https://chromium-review.googlesource.com/918062 Commit-Queue: Mrunal Kapade <mrunal.kapade@intel.com> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#584239} -- wpt-commits: 6c2d23b1b5e4dc00c944eedd16a11850e74a2d11 wpt-pr: 11704
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/wake-lock/wakelock-api.https.html
testing/web-platform/tests/wake-lock/wakelock-type.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -646222,17 +646222,17 @@
    "a5ff85281f875366aa3f22262e1a58beb60fe8f3",
    "support"
   ],
   "wake-lock/idlharness.https.window.js": [
    "21d559a7a26ac8e22bb9f0eaa02b7541015ad49d",
    "testharness"
   ],
   "wake-lock/wakelock-api.https.html": [
-   "7ec4fc2827a77421cc16838e2458443265c1dccf",
+   "45a906dfa1f23de34befdc68e9da17d179fb2474",
    "testharness"
   ],
   "wake-lock/wakelock-applicability-manual.https.html": [
    "5dbd27818ddfee7564c8e4def594adc67ed276f2",
    "manual"
   ],
   "wake-lock/wakelock-cancel-twice.https.html": [
    "68e8a1958165d9053eedf1bb97fd67e8eece15fb",
@@ -646286,17 +646286,17 @@
    "3d4c4868699c9c77a6636e3246c65de7b71dc36a",
    "testharness"
   ],
   "wake-lock/wakelock-state-is-global.https.html": [
    "98cebe01c1126e0ebdc26784e15e9a057d1a03fb",
    "testharness"
   ],
   "wake-lock/wakelock-type.https.html": [
-   "6f6413d1a916bd966ab3e82b49065672eaaa9372",
+   "2f9e1242614d57a79b2aada32cdd3d2cb3ae012d",
    "testharness"
   ],
   "wake-lock/wakelockrequest-is-independent.https.html": [
    "a113b004fe2a5dbcea8d11b1cedcca70841506bc",
    "testharness"
   ],
   "wasm/META.yml": [
    "3ea02ee7c9e41831aafbd37436f59b51244b142e",
--- a/testing/web-platform/tests/wake-lock/wakelock-api.https.html
+++ b/testing/web-platform/tests/wake-lock/wakelock-api.https.html
@@ -7,14 +7,14 @@
 
 <script>
 
 promise_test(async t => {
   assert_true("getWakeLock" in navigator, "Wake Lock API is present");
   const wakeLock = await navigator.getWakeLock("screen");
   const request = wakeLock.createRequest();
   assert_true(wakeLock instanceof WakeLock, "wakeLock is a WakeLock");
-  assert_true(wakeLock.type instanceof WakeLockType, "wakeLock.type is a WakeLockType");
+  assert_equals(typeof wakeLock.type, "string", "the type of wakeLock.type is string");
   assert_equals(typeof wakeLock.active, "boolean", "the type of wakeLock.active is boolean");
   assert_true(request instanceof WakeLockRequest, "request is a WakeLockRequest");
 }, "Test that the Wake Lock API is correct");
 
 </script>
--- a/testing/web-platform/tests/wake-lock/wakelock-type.https.html
+++ b/testing/web-platform/tests/wake-lock/wakelock-type.https.html
@@ -13,16 +13,16 @@ promise_test(async t => {
 }, "Test that wakeLock.type is 'screen' when screen wake lock is invoked");
 
 promise_test(async t => {
   const wakeLock = await navigator.getWakeLock("system");
   assert_equals(wakeLock.type, "system");
 }, "Test that wakeLock.type is 'system' when system wake lock is invoked");
 
 promise_test(t => {
-  return promise_rejects(t, new DOMException("", "NotSupportedError"), navigator.getWakeLock());
-}, "'NotSupportedError' is thrown when set an empty wake lock type");
+  return promise_rejects(t, new TypeError(), navigator.getWakeLock());
+}, "'TypeError' is thrown when set an empty wake lock type");
 
 promise_test(t => {
-  return promise_rejects(t, new DOMException("", "NotSupportedError"), navigator.getWakeLock("unsupported"));
-}, "'NotSupportedError' is thrown when set an unsupported wake lock type");
+  return promise_rejects(t, new TypeError(), navigator.getWakeLock("unsupported"));
+}, "'TypeError' is thrown when set an unsupported wake lock type");
 
 </script>