test_bug473284.xhtml (1783B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> 3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" 4 type="text/css"?> 5 <!-- 6 https://bugzilla.mozilla.org/show_bug.cgi?id=473284 7 --> 8 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 9 onload=" 10 var result = ''; 11 try { 12 document.commandDispatcher.advanceFocusIntoSubtree({}); 13 result += '1'; 14 } catch (ex) { 15 result += '.'; 16 } 17 18 try { 19 document.commandDispatcher.advanceFocusIntoSubtree(document.documentElement); 20 result += '2'; 21 } catch (ex) { 22 result += '.'; 23 } 24 25 try { 26 document.commandDispatcher.advanceFocusIntoSubtree(null); 27 result += '3'; 28 } catch (ex) { 29 result += '.'; 30 } 31 32 try { 33 document.commandDispatcher.focusedElement = {}; 34 result += '4'; 35 } catch (ex) { 36 result += '.'; 37 } 38 39 try { 40 document.commandDispatcher.focusedElement = document.documentElement; 41 result += '5'; 42 } catch (ex) { 43 result += '.'; 44 } 45 46 try { 47 document.commandDispatcher.focusedElement = null; 48 result += '6'; 49 } catch (ex) { 50 result += '.'; 51 } 52 53 try { 54 document.commandDispatcher.focusedWindow = {}; 55 result += 'a'; 56 } catch (ex) { 57 result += '.'; 58 } 59 60 try { 61 document.commandDispatcher.focusedWindow = null; 62 result += 'b'; 63 } catch (ex) { 64 result += '.'; 65 } 66 67 try { 68 document.commandDispatcher.focusedWindow = window; 69 result += 'c'; 70 } catch (ex) { 71 result += '.'; 72 } 73 74 is(result, '.23.56.bc', 'The correct assignments throw.'); 75 "> 76 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 77 78 <!-- test results are displayed in the html:body --> 79 <body xmlns="http://www.w3.org/1999/xhtml"> 80 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=473284" 81 target="_blank">Mozilla Bug 473284</a> 82 </body> 83 </window>