Additional crashtest fix follow up from bug 399227 - catch errors thrown by functions that now fail, so that the test completes properly FENNEC_A2
authorMark Banner <bugzilla@standard8.plus.com>
Mon, 22 Dec 2008 19:05:25 +0000
changeset 23001 8a601ed6bc4c
parent 23000 6d286de6fde3
child 23002 69d77c5270ed
push idunknown
push userunknown
push dateunknown
bugs399227
milestone1.9.2a1pre
Additional crashtest fix follow up from bug 399227 - catch errors thrown by functions that now fail, so that the test completes properly
layout/xul/base/src/tree/src/crashtests/399227-1.xul
layout/xul/base/src/tree/src/crashtests/399227-2.xul
--- a/layout/xul/base/src/tree/src/crashtests/399227-1.xul
+++ b/layout/xul/base/src/tree/src/crashtests/399227-1.xul
@@ -8,17 +8,22 @@
   <script>
   function boom()
   {
     var tree = document.getElementById("thetree");
     var selection = tree.view.selection;
 
     selection.select(0);
     tree.parentNode.removeChild(tree);
-    selection.rangedSelect(1, 1, false);
+
+    // This is expected to throw an error (it used to crash).
+    try {
+      selection.rangedSelect(1, 1, false);
+    }
+    catch (ex) {}
 
     document.documentElement.removeAttribute("class");
   }
   </script>
 
 <tree flex="1" id="thetree">
     <treecols>
       <treecol label="Name"/>
--- a/layout/xul/base/src/tree/src/crashtests/399227-2.xul
+++ b/layout/xul/base/src/tree/src/crashtests/399227-2.xul
@@ -1,27 +1,32 @@
 <?xml version="1.0"?>
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" class="reftest-wait" onload="setTimeout(boom, 30)">
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" class="reftest-wait" onload="setTimeout(boom, 30);">
 
 
   <script>
   function boom()
   {
     var tree = document.getElementById("thetree");
     var selection = tree.view.selection;
     var treecolumn0 = tree.columns[0];
     var treecolumn1 = tree.columns[1];
 
     selection.select(0);
     selection.currentColumn = treecolumn0;
     tree.parentNode.removeChild(tree);
-    selection.currentColumn = treecolumn1;
+
+    // This is expected to throw an error (it used to crash).
+    try {
+      selection.currentColumn = treecolumn1;
+    }
+    catch (ex) {}
 
     document.documentElement.removeAttribute("class");
   }
   </script>
 
 <tree flex="1" id="thetree" seltype="cell">
     <treecols>
       <treecol label="Name"/>