mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 14:57:32 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,78 @@
|
|||
const TEST_URL_PATH = "://example.org/browser/toolkit/components/passwordmgr/test/browser/";
|
||||
|
||||
add_task(function* setup() {
|
||||
let login = LoginTestUtils.testData.formLogin({
|
||||
hostname: "http://example.org",
|
||||
formSubmitURL: "http://example.org",
|
||||
username: "username",
|
||||
password: "password",
|
||||
});
|
||||
Services.logins.addLogin(login);
|
||||
login = LoginTestUtils.testData.formLogin({
|
||||
hostname: "http://example.org",
|
||||
formSubmitURL: "http://another.domain",
|
||||
username: "username",
|
||||
password: "password",
|
||||
});
|
||||
Services.logins.addLogin(login);
|
||||
yield SpecialPowers.pushPrefEnv({ "set": [["signon.autofillForms.http", false]] });
|
||||
});
|
||||
|
||||
add_task(function* test_http_autofill() {
|
||||
for (let scheme of ["http", "https"]) {
|
||||
let tab = yield BrowserTestUtils
|
||||
.openNewForegroundTab(gBrowser, `${scheme}${TEST_URL_PATH}form_basic.html`);
|
||||
|
||||
let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
|
||||
let doc = content.document;
|
||||
let contentUsername = doc.getElementById("form-basic-username").value;
|
||||
let contentPassword = doc.getElementById("form-basic-password").value;
|
||||
return [contentUsername, contentPassword];
|
||||
});
|
||||
|
||||
is(username, scheme == "http" ? "" : "username", "Username filled correctly");
|
||||
is(password, scheme == "http" ? "" : "password", "Password filled correctly");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(function* test_iframe_in_http_autofill() {
|
||||
for (let scheme of ["http", "https"]) {
|
||||
let tab = yield BrowserTestUtils
|
||||
.openNewForegroundTab(gBrowser, `${scheme}${TEST_URL_PATH}form_basic_iframe.html`);
|
||||
|
||||
let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
|
||||
let doc = content.document;
|
||||
let iframe = doc.getElementById("test-iframe");
|
||||
let contentUsername = iframe.contentWindow.document.getElementById("form-basic-username").value;
|
||||
let contentPassword = iframe.contentWindow.document.getElementById("form-basic-password").value;
|
||||
return [contentUsername, contentPassword];
|
||||
});
|
||||
|
||||
is(username, scheme == "http" ? "" : "username", "Username filled correctly");
|
||||
is(password, scheme == "http" ? "" : "password", "Password filled correctly");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(function* test_http_action_autofill() {
|
||||
for (let type of ["insecure", "secure"]) {
|
||||
let tab = yield BrowserTestUtils
|
||||
.openNewForegroundTab(gBrowser, `https${TEST_URL_PATH}form_cross_origin_${type}_action.html`);
|
||||
|
||||
let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
|
||||
let doc = content.document;
|
||||
let contentUsername = doc.getElementById("form-basic-username").value;
|
||||
let contentPassword = doc.getElementById("form-basic-password").value;
|
||||
return [contentUsername, contentPassword];
|
||||
});
|
||||
|
||||
is(username, type == "insecure" ? "" : "username", "Username filled correctly");
|
||||
is(password, type == "insecure" ? "" : "password", "Password filled correctly");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue