summaryrefslogtreecommitdiffstats
path: root/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js')
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js65
1 files changed, 0 insertions, 65 deletions
diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js
deleted file mode 100644
index 95bcee9ed..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function test() {
- waitForExplicitFinish();
-
- let pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- pwmgr.removeAllLogins();
-
- // add login data
- let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- let login = new nsLoginInfo("http://example.com/", "http://example.com/", null,
- "user", "password", "u1", "p1");
- pwmgr.addLogin(login);
-
- // Open the password manager dialog
- const PWMGR_DLG = "chrome://passwordmgr/content/passwordManager.xul";
- let pwmgrdlg = window.openDialog(PWMGR_DLG, "Toolkit:PasswordManager", "");
- SimpleTest.waitForFocus(doTest, pwmgrdlg);
-
- function doTest() {
- let doc = pwmgrdlg.document;
-
- let signonsTree = doc.querySelector("#signonsTree");
- is(signonsTree.view.rowCount, 1, "One entry in the passwords list");
-
- is(signonsTree.view.getCellText(0, signonsTree.columns.getNamedColumn("siteCol")),
- "http://example.com/",
- "Correct website saved");
-
- is(signonsTree.view.getCellText(0, signonsTree.columns.getNamedColumn("userCol")),
- "user",
- "Correct user saved");
-
- let timeCreatedCol = doc.getElementById("timeCreatedCol");
- is(timeCreatedCol.getAttribute("hidden"), "true",
- "Time created column is not displayed");
-
-
- let timeLastUsedCol = doc.getElementById("timeLastUsedCol");
- is(timeLastUsedCol.getAttribute("hidden"), "true",
- "Last Used column is not displayed");
-
- let timePasswordChangedCol = doc.getElementById("timePasswordChangedCol");
- is(timePasswordChangedCol.getAttribute("hidden"), "",
- "Last Changed column is displayed");
-
- // cleanup
- Services.ww.registerNotification(function (aSubject, aTopic, aData) {
- if (aSubject.location == pwmgrdlg.location && aTopic == "domwindowclosed") {
- // unregister ourself
- Services.ww.unregisterNotification(arguments.callee);
-
- pwmgr.removeAllLogins();
-
- finish();
- }
- });
-
- pwmgrdlg.close();
- }
-}