js/xpconnect/tests/chrome/test_bug743843.xul

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:f2e1fadc0592
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=743843
6 -->
7 <window title="Mozilla Bug 743843"
8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
9 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
10
11 <!-- test results are displayed in the html:body -->
12 <body xmlns="http://www.w3.org/1999/xhtml">
13 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=743843"
14 target="_blank">Mozilla Bug 743843</a>
15 </body>
16
17 <!-- test code goes here -->
18 <script type="application/javascript">
19 <![CDATA[
20 /** Test for Components.Exception options objects. **/
21
22 // Note: We pass |window| as the 'data' field here because Components.Exception
23 // doesn't handle JS Objects here all that nicely. See bug 743121.
24
25 // Test the old interface.
26 var e1 = Components.Exception('foo', Components.results.NS_BINDING_ABORTED, null, window);
27 is(e1.result, Components.results.NS_BINDING_ABORTED, "Result should get set properly");
28 is(e1.data, window, "User data should get set properly");
29
30 // Test the options object.
31 var e2 = Components.Exception('foo', { result: Components.results.NS_BINDING_ABORTED,
32 data: window,
33 foobar: 2 });
34 is(e2.result, Components.results.NS_BINDING_ABORTED, "Result should get set properly");
35 is(e2.data.window, window, "User data should get set properly");
36
37 ]]>
38 </script>
39 </window>

mercurial