Bug 862247 - Fix Contacts/Settings tests not running individually. r=gwagner

--HG--
extra : rebase_source : c9048a4680383576f329c4dcfb139a8e05633076
This commit is contained in:
Reuben Morais 2013-04-16 14:01:13 +02:00
parent 510eab17b7
commit 9ec99ed2dd
6 changed files with 43 additions and 23 deletions

View File

@ -1,17 +1,17 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id={674720}
https://bugzilla.mozilla.org/show_bug.cgi?id=674720
-->
<head>
<title>Test for Bug {674720} WebContacts</title>
<title>Test for Bug 674720 WebContacts</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id={674720}">Mozilla Bug {674720}</a>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=674720">Mozilla Bug 674720</a>
<p id="display"></p>
<div id="content" style="display: none">

View File

@ -1,17 +1,17 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id={674720}
https://bugzilla.mozilla.org/show_bug.cgi?id=674720
-->
<head>
<title>Test for Bug {674720} WebContacts</title>
<title>Test for Bug 674720 WebContacts</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id={674720}">Mozilla Bug {674720}</a>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=674720">Mozilla Bug 674720</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -35,6 +35,8 @@ SpecialPowers.addPermission("contacts-create", true, document);
var utils = SpecialPowers.getDOMWindowUtils(window);
function tests() {
function getView(size)
{
var buffer = new ArrayBuffer(size);
@ -130,7 +132,7 @@ function verifyBlob(blob1, blob2, isLast)
verifyBuffers(buffer1, buffer2, isLast);
}
}
var reader2 = new FileReader();
reader2.readAsArrayBuffer(blob1);
reader2.onload = function(event) {
@ -155,7 +157,6 @@ function verifyBlobArray(blobs1, blobs2)
verifyBlob(blobs1[i], blobs2[i], i == blobs1.length - 1);
}
var req;
var index = 0;
@ -314,9 +315,12 @@ function permissionTest() {
}
}
permissionTest();
}
var gContactsEnabled = SpecialPowers.getBoolPref("dom.mozContacts.enabled");
addLoadEvent(tests);
SimpleTest.waitForExplicitFinish();
addLoadEvent(permissionTest);
ok(true, "test passed");
</script>

View File

@ -52,9 +52,7 @@ let properties1 = {
email: [{type: ["work"], value: "x@y.com"}]
};
function onUnwantedSuccess() {
ok(false, "onUnwantedSuccess: shouldn't get here");
}
function tests() {
function onFailure() {
ok(false, "in on Failure!");
@ -415,9 +413,12 @@ function permissionTest() {
}
}
permissionTest();
}
let gContactsEnabled = SpecialPowers.getBoolPref("dom.mozContacts.enabled");
addLoadEvent(tests);
SimpleTest.waitForExplicitFinish();
addLoadEvent(permissionTest);
</script>
</pre>
</body>

View File

@ -1,17 +1,17 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id={815833}
https://bugzilla.mozilla.org/show_bug.cgi?id=815833
-->
<head>
<title>Test for Bug {815833} WebContacts</title>
<title>Test for Bug 815833 WebContacts</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id={815833}">Mozilla Bug {815833}</a>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=815833">Mozilla Bug 815833</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -28,7 +28,7 @@ if (!SpecialPowers.getBoolPref("dom.mozContacts.enabled")) {
comp.utils.import("resource://gre/modules/PermissionPromptHelper.jsm");
SpecialPowers.setBoolPref("dom.mozContacts.enabled", true);
}
SpecialPowers.addPermission("contacts-write", true, document);
SpecialPowers.addPermission("contacts-read", true, document);
SpecialPowers.addPermission("contacts-create", true, document);
@ -58,6 +58,8 @@ var properties2 = {
tel: [{type: ["work"], value: shortNumber, carrier: "testCarrier"}]
};
function tests() {
var req;
var index = 0;
var createResult1;
@ -254,9 +256,12 @@ function permissionTest() {
}
}
permissionTest();
}
var gContactsEnabled = SpecialPowers.getBoolPref("dom.mozContacts.enabled");
addLoadEvent(tests);
SimpleTest.waitForExplicitFinish();
addLoadEvent(permissionTest);
ok(true, "test passed");
</script>

View File

@ -43,6 +43,8 @@ function onFailure() {
}
}
function tests() {
let mozSettings = window.navigator.mozSettings;
let req;
@ -154,9 +156,12 @@ function permissionTest() {
}
}
permissionTest();
}
let gSettingsEnabled = SpecialPowers.getBoolPref("dom.mozSettings.enabled");
addLoadEvent(tests);
SimpleTest.waitForExplicitFinish();
addLoadEvent(permissionTest);
</script>
</pre>
</body>

View File

@ -1,17 +1,17 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id={678695}
https://bugzilla.mozilla.org/show_bug.cgi?id=678695
-->
<head>
<title>Test for Bug {678695} Settings API</title>
<title>Test for Bug 678695 Settings API</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id={678695}">Mozilla Bug {678695}</a>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=678695">Mozilla Bug 678695</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -29,6 +29,8 @@ if (!SpecialPowers.getBoolPref("dom.mozSettings.enabled")) {
SpecialPowers.addPermission("settings-write", true, document);
SpecialPowers.addPermission("settings-read", true, document);
function tests() {
var screenBright = {"screen.brightness": 0.7};
function onFailure() {
@ -280,9 +282,12 @@ function permissionTest() {
}
}
permissionTest();
}
var gSettingsEnabled = SpecialPowers.getBoolPref("dom.mozSettings.enabled");
addLoadEvent(tests);
SimpleTest.waitForExplicitFinish();
addLoadEvent(permissionTest);
ok(true, "test passed");
</script>