mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Backed out changeset f835989efa64 (bug 949537) for mochitest failures.
CLOSED TREE
This commit is contained in:
parent
8a14943148
commit
85e40fdd0b
@ -417,7 +417,6 @@ pref("dom.global-constructor.disable.mozContact", false);
|
||||
pref("dom.phonenumber.substringmatching.BR", 8);
|
||||
pref("dom.phonenumber.substringmatching.CO", 10);
|
||||
pref("dom.phonenumber.substringmatching.VE", 7);
|
||||
pref("dom.phonenumber.substringmatching.CL", 8);
|
||||
|
||||
// WebAlarms
|
||||
pref("dom.mozAlarms.enabled", true);
|
||||
|
@ -13,7 +13,6 @@ skip-if = (toolkit == 'gonk' && debug) #debug-only failure
|
||||
[test_contacts_international.html]
|
||||
[test_contacts_substringmatching.html]
|
||||
[test_contacts_substringmatchingVE.html]
|
||||
[test_contacts_substringmatchingCL.html]
|
||||
[test_migration.html]
|
||||
support-files =
|
||||
test_migration_chrome.js
|
||||
|
@ -402,17 +402,15 @@ function next() {
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function start_tests() {
|
||||
// Skip tests on Android < 4.0 due to test failures on tbpl (see bugs 897924 & 888891)
|
||||
let androidVersion = SpecialPowers.Cc['@mozilla.org/system-info;1']
|
||||
.getService(SpecialPowers.Ci.nsIPropertyBag2)
|
||||
.getProperty('version');
|
||||
if (!isAndroid || androidVersion >= 14) {
|
||||
next();
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(next);
|
||||
} else {
|
||||
ok(true, "Skip tests on Android < 4.0 (bugs 897924 & 888891");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
@ -52,16 +52,6 @@ var properties3 = {
|
||||
tel: [{value: number3.international2}]
|
||||
};
|
||||
|
||||
var number4 = {
|
||||
local: "87654321",
|
||||
international: "+56 9 87654321"
|
||||
};
|
||||
|
||||
var properties4 = {
|
||||
name: ["Testname2"],
|
||||
tel: [{value: number4.international}]
|
||||
};
|
||||
|
||||
var req;
|
||||
var createResult1;
|
||||
var findResult1;
|
||||
@ -234,7 +224,7 @@ var steps = [
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Adding a contact with a Brazilian country code");
|
||||
ok(true, "Adding a new contact with country code");
|
||||
createResult1 = new mozContact(properties3);
|
||||
req = navigator.mozContacts.save(createResult1);
|
||||
req.onsuccess = function () {
|
||||
@ -245,7 +235,7 @@ var steps = [
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Searching for Brazilian number with prefix");
|
||||
ok(true, "Searching for international number with prefix");
|
||||
var options = {filterBy: ["tel"],
|
||||
filterOp: "match",
|
||||
filterValue: number3.international1};
|
||||
@ -267,54 +257,6 @@ var steps = [
|
||||
}
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Adding a contact with a Chilean number");
|
||||
createResult1 = new mozContact(properties4);
|
||||
req = navigator.mozContacts.save(createResult1);
|
||||
req.onsuccess = function () {
|
||||
ok(createResult1.id, "The contact now has an ID.");
|
||||
sample_id1 = createResult1.id;
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Searching for Chilean number with prefix");
|
||||
req = mozContacts.find({
|
||||
filterBy: ["tel"],
|
||||
filterOp: "match",
|
||||
filterValue: number4.international
|
||||
});
|
||||
req.onsuccess = function () {
|
||||
ise(req.result.length, 1, "Found exactly 1 contact.");
|
||||
findResult1 = req.result[0];
|
||||
ise(findResult1.id, sample_id1, "Same ID");
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Searching for Chilean number using local number");
|
||||
req = mozContacts.find({
|
||||
filterBy: ["tel"],
|
||||
filterOp: "match",
|
||||
filterValue: number4.local
|
||||
});
|
||||
req.onsuccess = function () {
|
||||
ise(req.result.length, 0, "Found 0 contacts.");
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Deleting database");
|
||||
req = mozContacts.clear();
|
||||
req.onsuccess = function () {
|
||||
ok(true, "Deleted the database");
|
||||
next();
|
||||
}
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "all done!\n");
|
||||
SimpleTest.finish();
|
||||
|
@ -1,154 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=877302
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 949537 substring matching for 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=949537">Mozilla Bug 949537</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="text/javascript;version=1.8" src="http://mochi.test:8888/tests/dom/contacts/tests/shared.js"></script>
|
||||
<script class="testbody" type="text/javascript">
|
||||
"use strict";
|
||||
|
||||
var number = "+56 9 87654321";
|
||||
var landlineNumber = "+56 2 27654321";
|
||||
|
||||
var req;
|
||||
var steps = [
|
||||
clearDatabase,
|
||||
function () {
|
||||
ok(true, "Adding contact with mobile number");
|
||||
createResult1 = new mozContact({tel: [{value: number}]});
|
||||
req = navigator.mozContacts.save(createResult1);
|
||||
req.onsuccess = function () {
|
||||
ok(createResult1.id, "The contact now has an ID.");
|
||||
sample_id1 = createResult1.id;
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Retrieving all contacts");
|
||||
req = mozContacts.find({});
|
||||
req.onsuccess = function () {
|
||||
ise(req.result.length, 1, "One contact.");
|
||||
findResult1 = req.result[0];
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Retrieving by last 8 digits");
|
||||
req = mozContacts.find({
|
||||
filterBy: ["tel"],
|
||||
filterOp: "match",
|
||||
filterValue: number.slice(-8)
|
||||
});
|
||||
req.onsuccess = function () {
|
||||
ise(req.result.length, 1, "Found exactly 1 contact.");
|
||||
findResult1 = req.result[0];
|
||||
ise(findResult1.id, sample_id1, "Same ID");
|
||||
ise(findResult1.tel[0].value, number, "Same Value");
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Retrieving by last 9 digits");
|
||||
req = mozContacts.find({
|
||||
filterBy: ["tel"],
|
||||
filterOp: "match",
|
||||
filterValue: number.slice(-9)
|
||||
});
|
||||
req.onsuccess = function () {
|
||||
ise(req.result.length, 1, "Found exactly 1 contact.");
|
||||
findResult1 = req.result[0];
|
||||
ise(findResult1.id, sample_id1, "Same ID");
|
||||
ise(findResult1.tel[0].value, number, "Same Value");
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Retrieving by last 6 digits");
|
||||
req = mozContacts.find({
|
||||
filterBy: ["tel"],
|
||||
filterOp: "match",
|
||||
filterValue: number.slice(-6)
|
||||
});
|
||||
req.onsuccess = function () {
|
||||
ise(req.result.length, 0, "Found exactly zero contacts.");
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
|
||||
clearDatabase,
|
||||
|
||||
function () {
|
||||
ok(true, "Adding contact with landline number");
|
||||
createResult1 = new mozContact({tel: [{value: landlineNumber}]});
|
||||
req = navigator.mozContacts.save(createResult1);
|
||||
req.onsuccess = function () {
|
||||
ok(createResult1.id, "The contact now has an ID.");
|
||||
sample_id1 = createResult1.id;
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Retrieving all contacts");
|
||||
req = mozContacts.find({});
|
||||
req.onsuccess = function () {
|
||||
ise(req.result.length, 1, "One contact.");
|
||||
findResult1 = req.result[0];
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function () {
|
||||
ok(true, "Retrieving by last 7 digits (local number) with landline calling prefix");
|
||||
req = mozContacts.find({
|
||||
filterBy: ["tel"],
|
||||
filterOp: "match",
|
||||
filterValue: "022" + landlineNumber.slice(-7)
|
||||
});
|
||||
req.onsuccess = function () {
|
||||
ise(req.result.length, 1, "Found exactly 1 contact.");
|
||||
findResult1 = req.result[0];
|
||||
ise(findResult1.id, sample_id1, "Same ID");
|
||||
ise(findResult1.tel[0].value, landlineNumber, "Same Value");
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
|
||||
clearDatabase,
|
||||
|
||||
function () {
|
||||
ok(true, "all done!\n");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
];
|
||||
|
||||
SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["dom.phonenumber.substringmatching.CL", 8],
|
||||
["ril.lastKnownSimMcc", "730"]
|
||||
]
|
||||
}, start_tests);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user