Files
tubestation/browser/components/uitour/test/browser_openPreferences.js
Carsten "Tomcat" Book 036e6d2fa3 Backed out 2 changesets (bug 1202902) to recking bug 1202902 to be able to reopen inbound on a CLOSED TREE
Backed out changeset 647025383676 (bug 1202902)
Backed out changeset d70c7fe532c6 (bug 1202902)
2015-10-07 14:03:21 +02:00

44 lines
1.3 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var gTestTab;
var gContentAPI;
var gContentWindow;
function test() {
UITourTest();
}
var tests = [
taskify(function* test_openPreferences() {
let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, "about:preferences");
gContentAPI.openPreferences();
let tab = yield promiseTabOpened;
yield BrowserTestUtils.removeTab(tab);
}),
taskify(function* test_openInvalidPreferences() {
gContentAPI.openPreferences(999);
try {
yield waitForConditionPromise(() => {
return gBrowser.selectedBrowser.currentURI.spec.startsWith("about:preferences");
}, "Check if about:preferences opened");
ok(false, "No about:preferences tab should have opened");
} catch (ex) {
ok(true, "No about:preferences tab opened: " + ex);
}
}),
taskify(function* test_openPrivacyPreferences() {
let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, "about:preferences#privacy");
gContentAPI.openPreferences("privacy");
let tab = yield promiseTabOpened;
yield BrowserTestUtils.removeTab(tab);
}),
];