Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 function test() {
8 waitForExplicitFinish();
9 runTests();
10 }
12 gTests.push({
13 desc: "Test getPrompt with null domWindow (bug 949333)",
14 run: function () {
15 let factory = Cc["@mozilla.org/prompter;1"].getService(Ci.nsIPromptFactory);
16 let prompter = factory.getPrompt(null, Ci.nsIPrompt);
18 let browser = getBrowser();
19 let dialogOpened = false;
21 Task.spawn(function() {
22 yield waitForEvent(browser, "DOMWillOpenModalDialog");
23 dialogOpened = true;
25 yield waitForMs(0);
26 let stack = browser.parentNode;
27 let dialogs = stack.getElementsByTagNameNS(XUL_NS, "tabmodalprompt");
28 is(dialogs.length, 1, "one tab-modal dialog showing");
30 let dialog = dialogs[0];
31 let okButton = dialog.ui.button0;
32 okButton.click();
33 });
35 prompter.alert("Test", "test");
37 ok(dialogOpened, "Dialog was opened");
38 }
39 });