|
1 <html> |
|
2 <head> |
|
3 <title>Test for Bug 861605</title> |
|
4 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
7 <script type="text/javascript" src="prompt_common.js"></script> |
|
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
9 </head> |
|
10 <body onload="runtest()"> |
|
11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=861605">Mozilla Bug 861605</a> |
|
12 <pre id="test"> |
|
13 </pre> |
|
14 |
|
15 <script class="testbody" type="text/javascript"> |
|
16 SimpleTest.waitForExplicitFinish(); |
|
17 |
|
18 var selectionTest = false; |
|
19 var testNum = 0; |
|
20 |
|
21 function hasTabModalPrompts() { |
|
22 var prefName = "prompts.tab_modal.enabled"; |
|
23 var Services = SpecialPowers.Cu |
|
24 .import("resource://gre/modules/Services.jsm") |
|
25 .Services; |
|
26 return Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL && |
|
27 Services.prefs.getBoolPref(prefName); |
|
28 } |
|
29 |
|
30 function runtest() |
|
31 { |
|
32 isTabModal = hasTabModalPrompts(); |
|
33 if (!isTabModal) { |
|
34 todo(false, "Test is run with tab modal prompts disabled."); |
|
35 SimpleTest.finish(); |
|
36 return; |
|
37 } |
|
38 |
|
39 ok(true, "Test is run with tab modal prompts enabled."); |
|
40 |
|
41 startCallbackTimer(); |
|
42 |
|
43 try { |
|
44 alert(); |
|
45 ok(true, "alert() without arguments should not throw!"); |
|
46 } catch(e) { |
|
47 ok(false, "alert() without arguments should not throw!"); |
|
48 } |
|
49 |
|
50 startCallbackTimer(); |
|
51 |
|
52 try { |
|
53 confirm(); |
|
54 ok(true, "confirm() without arguments should not throw!"); |
|
55 } catch(e) { |
|
56 ok(false, "confirm() without arguments should not throw!"); |
|
57 } |
|
58 |
|
59 SimpleTest.finish(); |
|
60 } |
|
61 |
|
62 function handleDialog(ui, testNum) |
|
63 { |
|
64 synthesizeMouse(ui.button0, 5, 5, { }, SpecialPowers.unwrap(ui.button0.ownerDocument.defaultView)); |
|
65 } |
|
66 </script> |
|
67 |
|
68 </body> |
|
69 </html> |