Bug 626294 - [SeaMonkey] permanent "TEST-UNEXPECTED-FAIL | .../test_bug620145.html | got tabmodal promptbox"; (Av1) Fix bug 625038 nit, Fix bug 620145 case and bug 615186 case.

r=Olli.Pettay a=(test only).
This commit is contained in:
Serge Gautherie 2011-01-17 19:32:47 +01:00
parent 8ffea57af1
commit c0967d2cf9
2 changed files with 18 additions and 4 deletions

View File

@ -15,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=619644
<pre id="test">
<script class="testbody" type="text/javascript">
function hasTabModalPrompts() {
prefName = "prompts.tab_modal.enabled";
var prefName = "prompts.tab_modal.enabled";
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
Components.utils.import("resource://gre/modules/Services.jsm");
return Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL &&

View File

@ -30,6 +30,14 @@ var testNum = 0;
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
function hasTabModalPrompts() {
var prefName = "prompts.tab_modal.enabled";
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
Components.utils.import("resource://gre/modules/Services.jsm");
return Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL &&
Services.prefs.getBoolPref(prefName);
}
function openAlert() {
ok(true, "opening alert...");
alert("hello!");
@ -42,14 +50,18 @@ function runtest()
// Here we send the events to simulate clicking it.
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
ok(true, "starting test");
isTabModal = true;
isTabModal = hasTabModalPrompts();
if (!isTabModal)
todo(false, "Test is run with tab modal prompts disabled.");
else
ok(true, "Test is run with tab modal prompts enabled.");
startCallbackTimer();
var button = $("button");
dispatchMouseEvent(button, "mousedown");
dispatchMouseEvent(button, "mouseup");
selectionTest = true;
selectionTest = isTabModal;
startCallbackTimer();
@ -71,7 +83,9 @@ function dispatchMouseEvent(target, type)
function handleDialog(ui, testNum)
{
if (selectionTest) {
if (!selectionTest) {
todo(false, "Selection test is disabled when tab modal prompts are not enabled.");
} else {
synthesizeMouse($("text"), 25, 55, { type: "mousemove" });
is(window.getSelection().toString(), "", "selection not made");
synthesizeMouse(ui.button0, 5, 5, { }, ui.button0.ownerDocument.defaultView);