mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Bug 1310297 - Remove test annotations using b2g, mulet or gonk: dom/power. r=RyanVM
MozReview-Commit-ID: KAEQYNtLCI9 --HG-- extra : rebase_source : 49aa9c7c1fad7a94989a9a29959298ddb50708c0
This commit is contained in:
parent
b3c41167c9
commit
4f259eca87
@ -1,9 +1 @@
|
||||
[test_power_basics.html]
|
||||
[test_power_set_cpusleepallowed.html]
|
||||
skip-if = toolkit != "gonk"
|
||||
[test_power_set_screen_brightness.html]
|
||||
skip-if = toolkit != "gonk"
|
||||
[test_power_set_screen_enabled.html]
|
||||
skip-if = toolkit != "gonk"
|
||||
[test_power_set_key_light_enabled.html]
|
||||
skip-if = toolkit != "gonk"
|
||||
|
@ -1,4 +1,3 @@
|
||||
[test_bug957893.html]
|
||||
[test_bug957899.html]
|
||||
[test_wakelock_not_exposed.html]
|
||||
skip-if = appname == "b2g" || buildapp == "mulet"
|
||||
|
@ -1,55 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test Enabling/Disabling CPU Sleep with Power Management API</title>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
function testEnableSleep() {
|
||||
try {
|
||||
navigator.mozPower.cpuSleepAllowed = true;
|
||||
ok(navigator.mozPower.cpuSleepAllowed === true, "Allow entering suspend state.");
|
||||
} catch (e) {
|
||||
ok(false, "Unexpected exception trying to enable entering suspend state.");
|
||||
}
|
||||
}
|
||||
|
||||
function testDisableSleep() {
|
||||
try {
|
||||
navigator.mozPower.cpuSleepAllowed = false;
|
||||
ok(navigator.mozPower.cpuSleepAllowed === false, "Deny entering suspend state.");
|
||||
} catch (e) {
|
||||
ok(false, "Unexpected exception trying to disable entering suspend state.");
|
||||
}
|
||||
}
|
||||
|
||||
function startTests() {
|
||||
testDisableSleep();
|
||||
testEnableSleep();
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.expectAssertions(0, 9);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
// Currently only applicable on FxOS
|
||||
if (navigator.userAgent.indexOf("Mobile") != -1 &&
|
||||
navigator.appVersion.indexOf("Android") == -1) {
|
||||
startTests();
|
||||
} else {
|
||||
ok(true, "mozPower on Firefox OS only.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -1,58 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test Enabling/Disabling Screen with Power Management API</title>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
function testEnableKeyLight() {
|
||||
try {
|
||||
navigator.mozPower.keyLightEnabled = true;
|
||||
ok(navigator.mozPower.keyLightEnabled === true, "Enabled key backlight.");
|
||||
} catch (e) {
|
||||
ok(false, "Unexpected exception trying to enable key backlight.");
|
||||
}
|
||||
}
|
||||
|
||||
function testDisableKeyLight() {
|
||||
try {
|
||||
navigator.mozPower.keyLightEnabled = false;
|
||||
ok(navigator.mozPower.keyLightEnabled === false, "Disabled key backlight.");
|
||||
} catch (e) {
|
||||
ok(false, "Unexpected exception trying to disable key backlight.");
|
||||
}
|
||||
}
|
||||
|
||||
function startTests() {
|
||||
|
||||
// Make sure we don't suspend
|
||||
navigator.mozPower.cpuSleepAllowed = false;
|
||||
|
||||
testDisableKeyLight();
|
||||
testEnableKeyLight();
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
// Currently only applicable on FxOS
|
||||
if (navigator.userAgent.indexOf("Mobile") != -1 &&
|
||||
navigator.appVersion.indexOf("Android") == -1) {
|
||||
startTests();
|
||||
} else {
|
||||
ok(true, "mozPower on Firefox OS only.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -1,70 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test Setting Screen Brightness with Power Management API</title>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test setting brightness to a value < 0
|
||||
function testInvalidBrightness1() {
|
||||
try {
|
||||
navigator.mozPower.screenBrightness = -1;
|
||||
} catch (e) {
|
||||
return ok(true, "Invalid brightness level results in exception.");
|
||||
}
|
||||
ok(false, "Exeception not thrown for invalid brightness level.");
|
||||
}
|
||||
|
||||
// Test setting brightness to a value > 1
|
||||
function testInvalidBrightness2() {
|
||||
try {
|
||||
navigator.mozPower.screenBrightness = 2;
|
||||
} catch (e) {
|
||||
return ok(true, "Invalid brightness level results in exception.");
|
||||
}
|
||||
ok(false, "Exeception not thrown for invalid brightness level.");
|
||||
}
|
||||
|
||||
function testSettingBrightness() {
|
||||
var newBright = 0.312;
|
||||
navigator.mozPower.screenBrightness = newBright;
|
||||
ok(fuzzyEq(newBright, navigator.mozPower.screenBrightness),
|
||||
"Set new brightness value.");
|
||||
}
|
||||
|
||||
function startTests() {
|
||||
testInvalidBrightness1();
|
||||
testInvalidBrightness2();
|
||||
testSettingBrightness();
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function fuzzyEq(a, b) {
|
||||
var epsilon = 0.002;
|
||||
return Math.abs(a - b) < epsilon;
|
||||
}
|
||||
|
||||
SimpleTest.expectAssertions(0, 9);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
// Currently only applicable on FxOS
|
||||
if (navigator.userAgent.indexOf("Mobile") != -1 &&
|
||||
navigator.appVersion.indexOf("Android") == -1) {
|
||||
startTests();
|
||||
} else {
|
||||
ok(true, "mozPower on Firefox OS only.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -1,59 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test Enabling/Disabling Screen with Power Management API</title>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
"use strict";
|
||||
|
||||
function testEnableScreen() {
|
||||
try {
|
||||
navigator.mozPower.screenEnabled = true;
|
||||
ok(navigator.mozPower.screenEnabled === true, "Enabled screen.");
|
||||
} catch (e) {
|
||||
ok(false, "Unexpected exception trying to enable screen.");
|
||||
}
|
||||
}
|
||||
|
||||
function testDisableScreen() {
|
||||
try {
|
||||
navigator.mozPower.screenEnabled = false;
|
||||
ok(navigator.mozPower.screenEnabled === false, "Disabled screen.");
|
||||
} catch (e) {
|
||||
ok(false, "Unexpected exception trying to disable screen.");
|
||||
}
|
||||
}
|
||||
|
||||
function startTests() {
|
||||
|
||||
// Make sure we don't suspend
|
||||
navigator.mozPower.cpuSleepAllowed = false;
|
||||
|
||||
testDisableScreen();
|
||||
testEnableScreen();
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.expectAssertions(0, 9);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
// Currently only applicable on FxOS
|
||||
if (navigator.userAgent.indexOf("Mobile") != -1 &&
|
||||
navigator.appVersion.indexOf("Android") == -1) {
|
||||
startTests();
|
||||
} else {
|
||||
ok(true, "mozPower on Firefox OS only.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user