Closed Bug 854028 Opened 8 years ago Closed 8 years ago

New mochitests for Power Management API

Categories

(Core :: DOM: Core & HTML, defect)

22 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: Luqman, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

Some sanity tests for the Power API.
Attached patch Power api tests. (obsolete) — Splinter Review
Attachment #728489 - Flags: review?(kchen)
Comment on attachment 728489 [details] [diff] [review]
Power api tests.

Review of attachment 728489 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/power/test/Makefile.in
@@ +19,4 @@
>    $(NULL)
>  
>  MOCHITEST_BROWSER_FILES = \
> +  browser_wakelocks.js \

This file is not renamed in this patch right?

::: dom/power/test/test_power_set_screen_enabled.html
@@ +15,5 @@
> +  "use strict";
> +
> +  function testEnableScreen() {
> +    try {
> +      navigator.mozPower.screenEnabled = true;

If this is running on a real device then it might suspend the device here. Maybe set navigator.mozPower.cpuSleepAllowed to false first?
(In reply to Kan-Ru Chen [:kanru] from comment #2)
> Comment on attachment 728489 [details] [diff] [review]
> Power api tests.
> 
> Review of attachment 728489 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/power/test/Makefile.in
> @@ +19,4 @@
> >    $(NULL)
> >  
> >  MOCHITEST_BROWSER_FILES = \
> > +  browser_wakelocks.js \
> 
> This file is not renamed in this patch right?

It is renamed:
>diff --git a/dom/power/test/browser_bug697132.js b/dom/power/test/browser_wakelocks.js
>rename from dom/power/test/browser_bug697132.js
>rename to dom/power/test/browser_wakelocks.js


> 
> ::: dom/power/test/test_power_set_screen_enabled.html
> @@ +15,5 @@
> > +  "use strict";
> > +
> > +  function testEnableScreen() {
> > +    try {
> > +      navigator.mozPower.screenEnabled = true;
> 
> If this is running on a real device then it might suspend the device here.
> Maybe set navigator.mozPower.cpuSleepAllowed to false first?

I'm not sure whether the tests are run on an actual device, but it can't hurt to set this.
Attached patch Alarm api tests.Splinter Review
Attachment #728489 - Attachment is obsolete: true
Attachment #728489 - Flags: review?(kchen)
Attachment #729067 - Flags: review?(kchen)
Here's the try run from Friday:
https://tbpl.mozilla.org/?tree=Try&rev=6c88ce9c75bf
Attachment #729067 - Flags: review?(kchen) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d5bd0c5a4cba
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.