Bug 770730. (Av1) suite/common/dataman/tests/: Support w3.org and w3c-test.org, added by bug 756641, Fix nits. r=iann.
This commit is contained in:
Родитель
e12e5c524c
Коммит
802727570b
|
@ -15,16 +15,16 @@ var gLocSvc = {
|
|||
const DATAMAN_LOADED = "dataman-loaded";
|
||||
const TEST_DONE = "dataman-test-done";
|
||||
|
||||
var gPreexistingDomains = 10;
|
||||
const kPreexistingDomains = 12;
|
||||
|
||||
function test() {
|
||||
// Preload data.
|
||||
// Note that before this test starts, what is already set are permissions for
|
||||
// getpersonas.com and addons.mozilla.org to install addons as well as
|
||||
// permissions for a number of sites used in mochitest to load XUL/XBL.
|
||||
// For the latter, those domains are used/listed: 172.0.0.1, bank1.com,
|
||||
// For the latter, those 12 domains are used/listed: 127.0.0.1, bank1.com,
|
||||
// bank2.com, example.com, example.org, mochi.test, mozilla.com, test,
|
||||
// xn--exmple-cua.test, xn--hxajbheg2az3al.xn--jxalpdlp
|
||||
// w3.org, w3c-test.org, xn--exmple-cua.test, xn--hxajbheg2az3al.xn--jxalpdlp
|
||||
// We should not touch those permissions so other tests can run, which means
|
||||
// we should avoid using those domains altogether as we can't remove them.
|
||||
|
||||
|
@ -116,7 +116,7 @@ var testFuncs = [
|
|||
function test_open_state(aWin) {
|
||||
is(aWin.document.documentElement.id, "dataman-page",
|
||||
"The active tab is the Data Manager");
|
||||
is(aWin.gDomains.tree.view.rowCount, gPreexistingDomains + 6,
|
||||
is(aWin.gDomains.tree.view.rowCount, kPreexistingDomains + 6,
|
||||
"The correct number of domains is listed");
|
||||
is(aWin.gTabs.activePanel, "formdataPanel",
|
||||
"Form data panel is selected");
|
||||
|
@ -135,7 +135,7 @@ function test_open_state(aWin) {
|
|||
aWin.gDomains.tree.view.selection.select(0);
|
||||
aWin.document.getElementById("domainSearch").value = "";
|
||||
aWin.document.getElementById("domainSearch").doCommand();
|
||||
is(aWin.gDomains.tree.view.rowCount, gPreexistingDomains + 6,
|
||||
is(aWin.gDomains.tree.view.rowCount, kPreexistingDomains + 6,
|
||||
"After search, the correct number of domains is listed");
|
||||
is(aWin.gDomains.tree.view.selection.count, 1,
|
||||
"After search, number of selections is correct");
|
||||
|
@ -162,7 +162,7 @@ function test_forget_ipv6(aWin) {
|
|||
is(aWin.document.getElementById("forgetTab").disabled, true,
|
||||
"Forget panel is disabled again");
|
||||
|
||||
is(aWin.gDomains.tree.view.rowCount, gPreexistingDomains + 5,
|
||||
is(aWin.gDomains.tree.view.rowCount, kPreexistingDomains + 5,
|
||||
"The IPv6 domain has been removed from the list");
|
||||
is(aWin.gDomains.tree.view.selection.count, 0,
|
||||
"No domain is selected");
|
||||
|
@ -301,7 +301,7 @@ function test_cookies_panel(aWin) {
|
|||
"After selecting, the remove context menu item is enabled");
|
||||
|
||||
aWin.document.getElementById("cookies-context-remove").click();
|
||||
is(aWin.gDomains.tree.view.rowCount, gPreexistingDomains + 4,
|
||||
is(aWin.gDomains.tree.view.rowCount, kPreexistingDomains + 4,
|
||||
"The domain has been removed from the list");
|
||||
is(aWin.gTabs.activePanel, null,
|
||||
"No panel is active");
|
||||
|
@ -492,7 +492,7 @@ function test_permissions_add(aWin) {
|
|||
function test_prefs_panel(aWin) {
|
||||
Services.contentPrefs.setPref("my.drumbeat.org", "data_manager.test", "foo");
|
||||
Services.contentPrefs.setPref("drumbeat.org", "data_manager.test", "bar");
|
||||
is(aWin.gDomains.tree.view.rowCount, gPreexistingDomains + 5,
|
||||
is(aWin.gDomains.tree.view.rowCount, kPreexistingDomains + 5,
|
||||
"The domain for prefs tests has been added from the list");
|
||||
aWin.gDomains.tree.view.selection.select(4);
|
||||
is(aWin.gDomains.selectedDomain.title, "drumbeat.org",
|
||||
|
@ -557,7 +557,7 @@ function test_prefs_panel(aWin) {
|
|||
is(aWin.document.getElementById("forgetTab").disabled, true,
|
||||
"Forget panel is disabled again");
|
||||
|
||||
is(aWin.gDomains.tree.view.rowCount, gPreexistingDomains + 4,
|
||||
is(aWin.gDomains.tree.view.rowCount, kPreexistingDomains + 4,
|
||||
"The domain for prefs tests has been removed from the list");
|
||||
is(aWin.gDomains.tree.view.selection.count, 0,
|
||||
"No domain is selected");
|
||||
|
@ -666,7 +666,7 @@ function test_idn(aWin) {
|
|||
aWin.document.getElementById("domainSearch").value = "";
|
||||
aWin.document.getElementById("domainSearch").doCommand();
|
||||
|
||||
aWin.gDomains.tree.view.selection.select(gPreexistingDomains + 3);
|
||||
aWin.gDomains.tree.view.selection.select(kPreexistingDomains + 3);
|
||||
is(aWin.gDomains.selectedDomain.title, testDomain,
|
||||
"For IDN tests, correct domain is selected");
|
||||
is(aWin.gDomains.selectedDomain.displayTitle, idnDomain,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
const DATAMAN_LOADED = "dataman-loaded";
|
||||
|
||||
// See browser_dataman_basics.js.
|
||||
const kPreexistingDomains = 10;
|
||||
const kPreexistingDomains = 12;
|
||||
|
||||
var testIndex = 0;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче