Bug 664152 - move layout/base tests that depend heavily on enablePrivilege to mochitest-chrome. r=ehsan, a=test-only
authorJoel Maher <jmaher@mozilla.com>
Thu, 23 Jun 2011 11:46:35 -0400
changeset 71873 ae2dbbb7b935acedd7dd61afc11e98c6512dc2c3
parent 71872 0542577e399415a8f047956a18a03b469907540e
child 71874 10312d31fe7e4a9a86098e30d1f6d23cfceb8374
push idunknown
push userunknown
push dateunknown
reviewersehsan, test-only
bugs664152
milestone7.0a1
Bug 664152 - move layout/base tests that depend heavily on enablePrivilege to mochitest-chrome. r=ehsan, a=test-only
layout/base/tests/Makefile.in
layout/base/tests/bug106855-1-ref.html
layout/base/tests/bug106855-1.html
layout/base/tests/bug106855-2.html
layout/base/tests/bug240933-1-ref.html
layout/base/tests/bug240933-1.html
layout/base/tests/bug240933-2.html
layout/base/tests/bug389321-1-ref.html
layout/base/tests/bug389321-1.html
layout/base/tests/bug389321-2-ref.html
layout/base/tests/bug389321-2.html
layout/base/tests/bug389321-3-ref.html
layout/base/tests/bug389321-3.html
layout/base/tests/bug482484-ref.html
layout/base/tests/bug482484.html
layout/base/tests/bug512295-1-ref.html
layout/base/tests/bug512295-1.html
layout/base/tests/bug512295-2-ref.html
layout/base/tests/bug512295-2.html
layout/base/tests/bug585922-ref.html
layout/base/tests/bug585922.html
layout/base/tests/bug597519-1-ref.html
layout/base/tests/bug597519-1.html
layout/base/tests/bug602141-1-ref.html
layout/base/tests/bug602141-1.html
layout/base/tests/bug602141-2-ref.html
layout/base/tests/bug602141-2.html
layout/base/tests/bug602141-3-ref.html
layout/base/tests/bug602141-3.html
layout/base/tests/bug602141-4-ref.html
layout/base/tests/bug602141-4.html
layout/base/tests/bug612271-1.html
layout/base/tests/bug612271-2.html
layout/base/tests/bug612271-3.html
layout/base/tests/bug612271-ref.html
layout/base/tests/bug613433-1.html
layout/base/tests/bug613433-2.html
layout/base/tests/bug613433-3.html
layout/base/tests/bug613433-ref.html
layout/base/tests/bug613807-1-ref.html
layout/base/tests/bug613807-1.html
layout/base/tests/bug632215-1.html
layout/base/tests/bug632215-2.html
layout/base/tests/bug632215-ref.html
layout/base/tests/bug633044-1-ref.html
layout/base/tests/bug633044-1.html
layout/base/tests/bug634406-1-ref.html
layout/base/tests/bug634406-1.html
layout/base/tests/bug644428-1-ref.html
layout/base/tests/bug644428-1.html
layout/base/tests/bug646382-1-ref.html
layout/base/tests/bug646382-1.html
layout/base/tests/bug646382-2-ref.html
layout/base/tests/bug646382-2.html
layout/base/tests/chrome/Makefile.in
layout/base/tests/chrome/bug106855-1-ref.html
layout/base/tests/chrome/bug106855-1.html
layout/base/tests/chrome/bug106855-2.html
layout/base/tests/chrome/bug240933-1-ref.html
layout/base/tests/chrome/bug240933-1.html
layout/base/tests/chrome/bug240933-2.html
layout/base/tests/chrome/bug389321-1-ref.html
layout/base/tests/chrome/bug389321-1.html
layout/base/tests/chrome/bug389321-2-ref.html
layout/base/tests/chrome/bug389321-2.html
layout/base/tests/chrome/bug389321-3-ref.html
layout/base/tests/chrome/bug389321-3.html
layout/base/tests/chrome/bug482484-ref.html
layout/base/tests/chrome/bug482484.html
layout/base/tests/chrome/bug512295-1-ref.html
layout/base/tests/chrome/bug512295-1.html
layout/base/tests/chrome/bug512295-2-ref.html
layout/base/tests/chrome/bug512295-2.html
layout/base/tests/chrome/bug585922-ref.html
layout/base/tests/chrome/bug585922.html
layout/base/tests/chrome/bug597519-1-ref.html
layout/base/tests/chrome/bug597519-1.html
layout/base/tests/chrome/bug602141-1-ref.html
layout/base/tests/chrome/bug602141-1.html
layout/base/tests/chrome/bug602141-2-ref.html
layout/base/tests/chrome/bug602141-2.html
layout/base/tests/chrome/bug602141-3-ref.html
layout/base/tests/chrome/bug602141-3.html
layout/base/tests/chrome/bug602141-4-ref.html
layout/base/tests/chrome/bug602141-4.html
layout/base/tests/chrome/bug612271-1.html
layout/base/tests/chrome/bug612271-2.html
layout/base/tests/chrome/bug612271-3.html
layout/base/tests/chrome/bug612271-ref.html
layout/base/tests/chrome/bug613433-1.html
layout/base/tests/chrome/bug613433-2.html
layout/base/tests/chrome/bug613433-3.html
layout/base/tests/chrome/bug613433-ref.html
layout/base/tests/chrome/bug613807-1-ref.html
layout/base/tests/chrome/bug613807-1.html
layout/base/tests/chrome/bug632215-1.html
layout/base/tests/chrome/bug632215-2.html
layout/base/tests/chrome/bug632215-ref.html
layout/base/tests/chrome/bug633044-1-ref.html
layout/base/tests/chrome/bug633044-1.html
layout/base/tests/chrome/bug634406-1-ref.html
layout/base/tests/chrome/bug634406-1.html
layout/base/tests/chrome/bug644428-1-ref.html
layout/base/tests/chrome/bug644428-1.html
layout/base/tests/chrome/bug646382-1-ref.html
layout/base/tests/chrome/bug646382-1.html
layout/base/tests/chrome/bug646382-2-ref.html
layout/base/tests/chrome/bug646382-2.html
layout/base/tests/chrome/test_bug370436.html
layout/base/tests/chrome/test_bug396367-1.html
layout/base/tests/chrome/test_bug396367-2.html
layout/base/tests/chrome/test_bug420499.xul
layout/base/tests/chrome/test_reftests_with_caret.html
layout/base/tests/test_reftests_with_caret.html
--- a/layout/base/tests/Makefile.in
+++ b/layout/base/tests/Makefile.in
@@ -85,70 +85,16 @@ DEFINES += -D_IMPL_NS_LAYOUT
 		test_bug458898.html \
 		test_bug465448.xul \
 		test_bug469170.html \
 		test_bug471126.html \
 		test_bug435293-scale.html \
 		test_bug435293-interaction.html \
 		test_bug435293-skew.html \
 		test_bug495648.xul \
-		test_reftests_with_caret.html \
-		     bug106855-1.html \
-		     bug106855-2.html \
-		     bug106855-1-ref.html \
-		     bug240933-1.html \
-		     bug240933-2.html \
-		     bug240933-1-ref.html \
-		     bug389321-1.html \
-		     bug389321-1-ref.html \
-		     bug389321-2.html \
-		     bug389321-2-ref.html \
-		     bug389321-3.html \
-		     bug389321-3-ref.html \
-		     bug482484.html \
-		     bug482484-ref.html \
-		     bug512295-1.html \
-		     bug512295-1-ref.html \
-		     bug512295-2.html \
-		     bug512295-2-ref.html \
-		     bug585922.html \
-		     bug585922-ref.html \
-		     bug597519-1.html \
-		     bug597519-1-ref.html \
-		     bug602141-1.html \
-		     bug602141-1-ref.html \
-		     bug602141-2.html \
-		     bug602141-2-ref.html \
-		     bug602141-3.html \
-		     bug602141-3-ref.html \
-		     bug602141-4.html \
-		     bug602141-4-ref.html \
-		     bug612271-1.html \
-		     bug612271-2.html \
-		     bug612271-3.html \
-		     bug612271-ref.html \
-		     bug613433-1.html \
-		     bug613433-2.html \
-		     bug613433-3.html \
-		     bug613433-ref.html \
-		     bug613807-1.html \
-		     bug613807-1-ref.html \
-		     bug632215-1.html \
-		     bug632215-2.html \
-		     bug632215-ref.html \
-		     bug633044-1.html \
-		     bug633044-1-ref.html \
-		     bug634406-1.html \
-		     bug634406-1-ref.html \
-		     bug644428-1.html \
-		     bug644428-1-ref.html \
-		     bug646382-1.html \
-		     bug646382-1-ref.html \
-		     bug646382-2.html \
-		     bug646382-2-ref.html \
 		test_bug514127.html \
 		test_bug518777.html \
 		test_bug548545.xhtml \
 		test_bug558663.html \
 		test_bug559499.html \
 		test_bug582181-1.html \
 		test_bug582181-2.html \
 		test_flush_on_paint.html \
--- a/layout/base/tests/chrome/Makefile.in
+++ b/layout/base/tests/chrome/Makefile.in
@@ -33,17 +33,17 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH     = ../../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
-relativesrcdir  = layout/base/test/chrome
+relativesrcdir  = layout/base/tests/chrome
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _CHROME_FILES = \
 	test_bug370436.html \
 	test_bug396367-1.html \
 	test_bug396367-2.html \
@@ -61,12 +61,66 @@ include $(topsrcdir)/config/rules.mk
 	     default_background_window.xul \
     test_leaf_layers_partition_browser_window.xul \
 	test_printpreview.xul \
 	     printpreview_helper.xul \
 	test_printpreview_bug396024.xul \
 	     printpreview_bug396024_helper.xul \
 	test_printpreview_bug482976.xul \
 	     printpreview_bug482976_helper.xul \
+	test_reftests_with_caret.html \
+	     bug585922.html \
+	     bug585922-ref.html \
+	     bug613807-1.html \
+	     bug613807-1-ref.html \
+	     bug106855-1.html \
+	     bug106855-2.html \
+	     bug106855-1-ref.html \
+	     bug240933-1.html \
+	     bug240933-2.html \
+	     bug240933-1-ref.html \
+	     bug389321-1.html \
+	     bug389321-1-ref.html \
+	     bug389321-2.html \
+	     bug389321-2-ref.html \
+	     bug389321-3.html \
+	     bug389321-3-ref.html \
+	     bug482484.html \
+	     bug482484-ref.html \
+	     bug512295-1.html \
+	     bug512295-1-ref.html \
+	     bug512295-2.html \
+	     bug512295-2-ref.html \
+	     bug597519-1.html \
+	     bug597519-1-ref.html \
+	     bug602141-1.html \
+	     bug602141-1-ref.html \
+	     bug602141-2.html \
+	     bug602141-2-ref.html \
+	     bug602141-3.html \
+	     bug602141-3-ref.html \
+	     bug602141-4.html \
+	     bug602141-4-ref.html \
+	     bug612271-1.html \
+	     bug612271-2.html \
+	     bug612271-3.html \
+	     bug612271-ref.html \
+	     bug613433-1.html \
+	     bug613433-2.html \
+	     bug613433-3.html \
+	     bug613433-ref.html \
+	     bug632215-1.html \
+	     bug632215-2.html \
+	     bug632215-ref.html \
+	     bug633044-1.html \
+	     bug633044-1-ref.html \
+	     bug634406-1.html \
+	     bug634406-1-ref.html \
+	     bug644428-1.html \
+	     bug644428-1-ref.html \
+	     bug646382-1.html \
+	     bug646382-1-ref.html \
+	     bug646382-2.html \
+	     bug646382-2-ref.html \
     $(NULL)
 
 libs:: $(_CHROME_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
rename from layout/base/tests/bug106855-1-ref.html
rename to layout/base/tests/chrome/bug106855-1-ref.html
--- a/layout/base/tests/bug106855-1-ref.html
+++ b/layout/base/tests/chrome/bug106855-1-ref.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 x<br>
 <textarea id="t" rows="4">
 A
 
 
 </textarea><br>
rename from layout/base/tests/bug106855-1.html
rename to layout/base/tests/chrome/bug106855-1.html
--- a/layout/base/tests/bug106855-1.html
+++ b/layout/base/tests/chrome/bug106855-1.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 x<br>
 <textarea id="t" rows="4">
 A
 
 
 </textarea><br>
rename from layout/base/tests/bug106855-2.html
rename to layout/base/tests/chrome/bug106855-2.html
--- a/layout/base/tests/bug106855-2.html
+++ b/layout/base/tests/chrome/bug106855-2.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 x<br>
 <textarea id="t" rows="4">
 A
 
 
 </textarea><br>
rename from layout/base/tests/bug240933-1-ref.html
rename to layout/base/tests/chrome/bug240933-1-ref.html
rename from layout/base/tests/bug240933-1.html
rename to layout/base/tests/chrome/bug240933-1.html
--- a/layout/base/tests/bug240933-1.html
+++ b/layout/base/tests/chrome/bug240933-1.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <textarea id="t" rows="4"></textarea>
 <script>
   var area = document.getElementById('t');
   area.focus();
 
   sendKey('ENTER', "t"); // press Enter once
rename from layout/base/tests/bug240933-2.html
rename to layout/base/tests/chrome/bug240933-2.html
--- a/layout/base/tests/bug240933-2.html
+++ b/layout/base/tests/chrome/bug240933-2.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <textarea id="t" rows="4"></textarea>
 <script>
   var area = document.getElementById('t');
   area.focus();
 
   sendKey('ENTER', "t"); // press Enter twice
rename from layout/base/tests/bug389321-1-ref.html
rename to layout/base/tests/chrome/bug389321-1-ref.html
--- a/layout/base/tests/bug389321-1-ref.html
+++ b/layout/base/tests/chrome/bug389321-1-ref.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <span contenteditable id="t" style="border: 1px dashed green; min-height: 2px; padding-right: 20px;"> </span></body>
 <script>
   // Only focus the span to put the caret at its beginning
   var sel = window.getSelection();
   sel.removeAllRanges();
 
rename from layout/base/tests/bug389321-1.html
rename to layout/base/tests/chrome/bug389321-1.html
--- a/layout/base/tests/bug389321-1.html
+++ b/layout/base/tests/chrome/bug389321-1.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <span contenteditable id="t" style="border: 1px dashed green; min-height: 2px; padding-right: 20px;"> </span></body>
 <script>
   // Enter a character in the span and delete it
   var sel = window.getSelection();
   sel.removeAllRanges();
 
rename from layout/base/tests/bug389321-2-ref.html
rename to layout/base/tests/chrome/bug389321-2-ref.html
rename from layout/base/tests/bug389321-2.html
rename to layout/base/tests/chrome/bug389321-2.html
rename from layout/base/tests/bug389321-3-ref.html
rename to layout/base/tests/chrome/bug389321-3-ref.html
rename from layout/base/tests/bug389321-3.html
rename to layout/base/tests/chrome/bug389321-3.html
rename from layout/base/tests/bug482484-ref.html
rename to layout/base/tests/chrome/bug482484-ref.html
rename from layout/base/tests/bug482484.html
rename to layout/base/tests/chrome/bug482484.html
--- a/layout/base/tests/bug482484.html
+++ b/layout/base/tests/chrome/bug482484.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <div contentEditable="true" id="div"><p id="p">BC</p></div>
 <script>
   // Position the caret before the "B"
   var div = document.getElementById('div');
   div.focus();
   var p = document.getElementById('p');
rename from layout/base/tests/bug512295-1-ref.html
rename to layout/base/tests/chrome/bug512295-1-ref.html
--- a/layout/base/tests/bug512295-1-ref.html
+++ b/layout/base/tests/chrome/bug512295-1-ref.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <div contenteditable="true">
 <p id="p">A B CD EFG<br>
   1234567890</p>
 </div>
 x
 <script>
rename from layout/base/tests/bug512295-1.html
rename to layout/base/tests/chrome/bug512295-1.html
--- a/layout/base/tests/bug512295-1.html
+++ b/layout/base/tests/chrome/bug512295-1.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <div contenteditable="true">
 <p id="p">A B CD EFG<br>
   1234567890</p>
 </div>
 x
 <script>
rename from layout/base/tests/bug512295-2-ref.html
rename to layout/base/tests/chrome/bug512295-2-ref.html
--- a/layout/base/tests/bug512295-2-ref.html
+++ b/layout/base/tests/chrome/bug512295-2-ref.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 x
 <div contenteditable="true">
 <p id="p">A B CD EFG<br>
   1234567890</p>
 </div>
 <script>
rename from layout/base/tests/bug512295-2.html
rename to layout/base/tests/chrome/bug512295-2.html
--- a/layout/base/tests/bug512295-2.html
+++ b/layout/base/tests/chrome/bug512295-2.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 x
 <div contenteditable="true">
 <p id="p">A B CD EFG<br>
   1234567890</p>
 </div>
 <script>
rename from layout/base/tests/bug585922-ref.html
rename to layout/base/tests/chrome/bug585922-ref.html
--- a/layout/base/tests/bug585922-ref.html
+++ b/layout/base/tests/chrome/bug585922-ref.html
@@ -1,20 +1,17 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
   <head>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   </head>
   <body onload="doTest()">
     <input type=text>
     <script>
       function doTest() {
-        netscape.security.PrivilegeManager.enablePrivilege(
-          "UniversalXPConnect");
-
         var d = document.querySelector("input");
         d.value = "b";
         d.focus();
         var editor = d.QueryInterface(Components.interfaces.nsIDOMNSEditableElement).editor;
         var sel = editor.selection;
         var t = editor.rootElement.firstChild;
         sel.collapse(t, 1); // put the caret at the end of the textbox
         document.documentElement.removeAttribute("class");
rename from layout/base/tests/bug585922.html
rename to layout/base/tests/chrome/bug585922.html
--- a/layout/base/tests/bug585922.html
+++ b/layout/base/tests/chrome/bug585922.html
@@ -1,34 +1,30 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
   <head>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   </head>
   <body onload="doTest()">
     <input type=text>
     <script>
       function doTest() {
-        netscape.security.PrivilegeManager.enablePrivilege(
-          "UniversalXPConnect");
         function enableCaret(aEnable) {
           var selCon = editor.selectionController;
           selCon.setCaretEnabled(aEnable);
         }
 
         var d = document.querySelector("input");
         d.value = "a";
         d.focus();
         var editor = d.QueryInterface(Components.interfaces.nsIDOMNSEditableElement).editor;
         var sel = editor.selection;
         var t = editor.rootElement.firstChild;
         sel.collapse(t, 1); // put the caret at the end of the div
         setTimeout(function() {
-          netscape.security.PrivilegeManager.enablePrivilege(
-            "UniversalXPConnect");
           enableCaret(false);enableCaret(true);// force a caret display
           enableCaret(false); // hide the caret
           t.replaceData(0, 1, "b"); // replace the text node data
           // at this point, the selection is collapsed to offset 0
           synthesizeQuerySelectedText(); // call nsCaret::GetGeometry
           sel.collapse(t, 1); // put the caret at the end again
           enableCaret(true); // show the caret again
           document.documentElement.removeAttribute("class");
rename from layout/base/tests/bug597519-1-ref.html
rename to layout/base/tests/chrome/bug597519-1-ref.html
rename from layout/base/tests/bug597519-1.html
rename to layout/base/tests/chrome/bug597519-1.html
--- a/layout/base/tests/bug597519-1.html
+++ b/layout/base/tests/chrome/bug597519-1.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <textarea maxlength="3"></textarea>
 <script>
   var t = document.querySelector("textarea");
   t.focus();
 
   synthesizeKey("a", {});
rename from layout/base/tests/bug602141-1-ref.html
rename to layout/base/tests/chrome/bug602141-1-ref.html
rename from layout/base/tests/bug602141-1.html
rename to layout/base/tests/chrome/bug602141-1.html
--- a/layout/base/tests/bug602141-1.html
+++ b/layout/base/tests/chrome/bug602141-1.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <span contenteditable="true">navigable__</span><span id="x" contenteditable="true">navigable|unnavigable</span><br />
 <script>
   // Position the caret after "|"
   var sel = window.getSelection();
   sel.removeAllRanges();
   var range = document.createRange();
rename from layout/base/tests/bug602141-2-ref.html
rename to layout/base/tests/chrome/bug602141-2-ref.html
rename from layout/base/tests/bug602141-2.html
rename to layout/base/tests/chrome/bug602141-2.html
--- a/layout/base/tests/bug602141-2.html
+++ b/layout/base/tests/chrome/bug602141-2.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <span id="x" contenteditable="true">navigable__|</span><br />
 <script>
   document.getElementById('x').appendChild(document.createTextNode('unnavigable'));
 
   // Position the caret after "|"
   var sel = window.getSelection();
rename from layout/base/tests/bug602141-3-ref.html
rename to layout/base/tests/chrome/bug602141-3-ref.html
rename from layout/base/tests/bug602141-3.html
rename to layout/base/tests/chrome/bug602141-3.html
--- a/layout/base/tests/bug602141-3.html
+++ b/layout/base/tests/chrome/bug602141-3.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 noteditable<span id="x" contenteditable="true">navigable|unnavigable</span><br />
 <script>
   // Position the caret after "|"
   var sel = window.getSelection();
   sel.removeAllRanges();
   var range = document.createRange();
rename from layout/base/tests/bug602141-4-ref.html
rename to layout/base/tests/chrome/bug602141-4-ref.html
rename from layout/base/tests/bug602141-4.html
rename to layout/base/tests/chrome/bug602141-4.html
--- a/layout/base/tests/bug602141-4.html
+++ b/layout/base/tests/chrome/bug602141-4.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <span>not editable</span><span id="x" contenteditable="true">navigable|unnavigable</span>
 <script>
   // Position the caret after "|"
   var sel = window.getSelection();
   sel.removeAllRanges();
   var range = document.createRange();
rename from layout/base/tests/bug612271-1.html
rename to layout/base/tests/chrome/bug612271-1.html
--- a/layout/base/tests/bug612271-1.html
+++ b/layout/base/tests/chrome/bug612271-1.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
  <textarea id="target" style="height: 100px"
     onkeydown="this.style.display='block';this.style.height='200px';">foo</textarea>
 <script>
   var t = document.querySelector("textarea");
   t.focus();
   t.selectionStart = t.selectionEnd = t.value.length;
rename from layout/base/tests/bug612271-2.html
rename to layout/base/tests/chrome/bug612271-2.html
--- a/layout/base/tests/bug612271-2.html
+++ b/layout/base/tests/chrome/bug612271-2.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
   <textarea id="target" style="height: 100px"
     onkeypress="this.style.display='block';this.style.height='200px';">foo</textarea>
 <script>
   var t = document.querySelector("textarea");
   t.focus();
   t.selectionStart = t.selectionEnd = t.value.length;
rename from layout/base/tests/bug612271-3.html
rename to layout/base/tests/chrome/bug612271-3.html
--- a/layout/base/tests/bug612271-3.html
+++ b/layout/base/tests/chrome/bug612271-3.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
   <textarea id="target" style="height: 100px"
     onkeyup="this.style.display='block';this.style.height='200px';">foo</textarea>
 <script>
   var t = document.querySelector("textarea");
   t.focus();
   t.selectionStart = t.selectionEnd = t.value.length;
rename from layout/base/tests/bug612271-ref.html
rename to layout/base/tests/chrome/bug612271-ref.html
--- a/layout/base/tests/bug612271-ref.html
+++ b/layout/base/tests/chrome/bug612271-ref.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   <script type="text/javascript">
     function loaded() {
       var t = document.querySelector("textarea");
       t.focus();
       t.selectionStart = t.selectionEnd = 4;
     }
   </script>
 </head>
rename from layout/base/tests/bug613433-1.html
rename to layout/base/tests/chrome/bug613433-1.html
--- a/layout/base/tests/bug613433-1.html
+++ b/layout/base/tests/chrome/bug613433-1.html
@@ -2,18 +2,18 @@
 <html class="reftest-wait">
   <head>
     <style>
       div {
         min-height: 36px;
         overflow-x: auto;
       }
     </style>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
     <script>
       function test() {
         document.querySelector("div").focus();
         // type a character, then press backspace to delete it
         sendKey("X", window);
         sendKey("BACK_SPACE", window);
         document.documentElement.removeAttribute("class");
       }
rename from layout/base/tests/bug613433-2.html
rename to layout/base/tests/chrome/bug613433-2.html
--- a/layout/base/tests/bug613433-2.html
+++ b/layout/base/tests/chrome/bug613433-2.html
@@ -2,18 +2,18 @@
 <html class="reftest-wait">
   <head>
     <style>
       div {
         min-height: 36px;
         overflow-y: auto;
       }
     </style>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
     <script>
       function test() {
         document.querySelector("div").focus();
         // type a character, then press backspace to delete it
         sendKey("X", window);
         sendKey("BACK_SPACE", window);
         document.documentElement.removeAttribute("class");
       }
rename from layout/base/tests/bug613433-3.html
rename to layout/base/tests/chrome/bug613433-3.html
--- a/layout/base/tests/bug613433-3.html
+++ b/layout/base/tests/chrome/bug613433-3.html
@@ -2,18 +2,18 @@
 <html class="reftest-wait">
   <head>
     <style>
       div {
         min-height: 36px;
         overflow: auto;
       }
     </style>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
     <script>
       function test() {
         document.querySelector("div").focus();
         // type a character, then press backspace to delete it
         sendKey("X", window);
         sendKey("BACK_SPACE", window);
         document.documentElement.removeAttribute("class");
       }
rename from layout/base/tests/bug613433-ref.html
rename to layout/base/tests/chrome/bug613433-ref.html
rename from layout/base/tests/bug613807-1-ref.html
rename to layout/base/tests/chrome/bug613807-1-ref.html
rename from layout/base/tests/bug613807-1.html
rename to layout/base/tests/chrome/bug613807-1.html
--- a/layout/base/tests/bug613807-1.html
+++ b/layout/base/tests/chrome/bug613807-1.html
@@ -1,22 +1,21 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <textarea id="t" rows="4"></textarea>
 <script>
   addLoadEvent(function() {
     var area = document.getElementById('t');
     area.focus();
 
-    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
     const nsIDOMWindowUtils = Components.interfaces.nsIDOMWindowUtils;
 
     // start composition
     synthesizeComposition(true);
 
     // input raw characters
     synthesizeText(
       { composition:
rename from layout/base/tests/bug632215-1.html
rename to layout/base/tests/chrome/bug632215-1.html
--- a/layout/base/tests/bug632215-1.html
+++ b/layout/base/tests/chrome/bug632215-1.html
@@ -1,13 +1,13 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
   <head>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   </head>
   <body>
     <iframe src="data:text/html,<body></body>"></iframe>
     <script>
       onload = function() {
         var i = document.querySelector("iframe");
         var d = i.contentDocument;
         var w = i.contentWindow;
rename from layout/base/tests/bug632215-2.html
rename to layout/base/tests/chrome/bug632215-2.html
--- a/layout/base/tests/bug632215-2.html
+++ b/layout/base/tests/chrome/bug632215-2.html
@@ -1,13 +1,13 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
   <head>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   </head>
   <body>
     <iframe src="data:text/html,<body contenteditable></body>"></iframe>
     <script>
       onload = function() {
         var i = document.querySelector("iframe");
         var d = i.contentDocument;
         var w = i.contentWindow;
rename from layout/base/tests/bug632215-ref.html
rename to layout/base/tests/chrome/bug632215-ref.html
rename from layout/base/tests/bug633044-1-ref.html
rename to layout/base/tests/chrome/bug633044-1-ref.html
rename from layout/base/tests/bug633044-1.html
rename to layout/base/tests/chrome/bug633044-1.html
--- a/layout/base/tests/bug633044-1.html
+++ b/layout/base/tests/chrome/bug633044-1.html
@@ -1,12 +1,12 @@
 <html>
   <head>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
     <script>
         onload = function() {
           var el;
           while (el = document.querySelector("br")) {
             el.parentNode.removeChild(el);
           }
           focus();
           document.body.focus();
rename from layout/base/tests/bug634406-1-ref.html
rename to layout/base/tests/chrome/bug634406-1-ref.html
rename from layout/base/tests/bug634406-1.html
rename to layout/base/tests/chrome/bug634406-1.html
--- a/layout/base/tests/bug634406-1.html
+++ b/layout/base/tests/chrome/bug634406-1.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML><html><head>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <body>
 <textarea></textarea>
 <script>
   var t = document.querySelector("textarea");
   t.focus();
 
   synthesizeKey("a", {});
rename from layout/base/tests/bug644428-1-ref.html
rename to layout/base/tests/chrome/bug644428-1-ref.html
--- a/layout/base/tests/bug644428-1-ref.html
+++ b/layout/base/tests/chrome/bug644428-1-ref.html
@@ -1,13 +1,13 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   </head>
   <body onload="setupCaret()">
     <div contenteditable>a</div>
     <script>
       function setupCaret() {
         var div = document.querySelector("div");
         div.focus();
         var sel = window.getSelection();
rename from layout/base/tests/bug644428-1.html
rename to layout/base/tests/chrome/bug644428-1.html
--- a/layout/base/tests/bug644428-1.html
+++ b/layout/base/tests/chrome/bug644428-1.html
@@ -1,13 +1,13 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   </head>
   <body onload="setupCaret()" spellcheck="false">
     <div contenteditable>a<span>b</span>c </div>
     <script>
       function setupCaret() {
         var div = document.querySelector("div");
         div.focus();
         var sel = window.getSelection();
rename from layout/base/tests/bug646382-1-ref.html
rename to layout/base/tests/chrome/bug646382-1-ref.html
rename from layout/base/tests/bug646382-1.html
rename to layout/base/tests/chrome/bug646382-1.html
--- a/layout/base/tests/bug646382-1.html
+++ b/layout/base/tests/chrome/bug646382-1.html
@@ -1,13 +1,13 @@
 <html class="reftest-wait">
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   </head>
   <body onload="start()">
     <textarea onfocus="typeIntoMe()"></textarea>
     <script>
       function start() {
         document.querySelector("textarea").focus();
       }
       function typeIntoMe() {
rename from layout/base/tests/bug646382-2-ref.html
rename to layout/base/tests/chrome/bug646382-2-ref.html
rename from layout/base/tests/bug646382-2.html
rename to layout/base/tests/chrome/bug646382-2.html
--- a/layout/base/tests/bug646382-2.html
+++ b/layout/base/tests/chrome/bug646382-2.html
@@ -1,12 +1,12 @@
 <html class="reftest-wait">
   <head>
-    <script type="text/javascript" src="/MochiKit/packed.js"></script>
-    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+    <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   </head>
   <body onload="start()">
     <textarea dir="rtl" onfocus="typeIntoMe()"></textarea>
     <script>
       function start() {
         document.querySelector("textarea").focus();
       }
       function typeIntoMe() {
--- a/layout/base/tests/chrome/test_bug370436.html
+++ b/layout/base/tests/chrome/test_bug370436.html
@@ -22,18 +22,16 @@ function expandStringOffsetToWord(data, 
 
 	var m1 = data.substr(0, offset).match(/\w+$/) || "";
 	var m2 = data.substr(offset).match(/^\w+/) || "";
 	return m1 + m2;
 }
 
 function onContextMenu(e)
 {
-	netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-
 	var node = e.rangeParent;
 	var offset = e.rangeOffset;
 
 	var word = expandStringOffsetToWord(node.data, offset);
 	words.push(word);
 }
 
 function startTest()
--- a/layout/base/tests/chrome/test_bug396367-1.html
+++ b/layout/base/tests/chrome/test_bug396367-1.html
@@ -14,17 +14,16 @@ https://bugzilla.mozilla.org/show_bug.cg
     function finish() {
       ok(true, "didn't crash");
       var docviewer = getdocviewer();
       docviewer.textZoom = 1;
       SimpleTest.finish();
     }
 
     function getdocviewer() {
-      //netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
       var navigator1 = top.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation);
       var docShell = navigator1.QueryInterface(Components.interfaces.nsIDocShell);
       var docviewer = docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
       return docviewer;
     }
   </script>
 </head>
 <body>
--- a/layout/base/tests/chrome/test_bug396367-2.html
+++ b/layout/base/tests/chrome/test_bug396367-2.html
@@ -15,17 +15,16 @@ https://bugzilla.mozilla.org/show_bug.cg
     function finish() {
       ok(true, "didn't crash");
       var docviewer = getdocviewer();
       docviewer.textZoom = 1;
       SimpleTest.finish();
     }
 
     function getdocviewer() {
-      //netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
       var navigator1 = top.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation);
       var docShell = navigator1.QueryInterface(Components.interfaces.nsIDocShell);
       var docviewer = docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
       return docviewer;
     }
   </script>
 </head>
 <body>
--- a/layout/base/tests/chrome/test_bug420499.xul
+++ b/layout/base/tests/chrome/test_bug420499.xul
@@ -63,17 +63,16 @@ https://bugzilla.mozilla.org/show_bug.cg
     function getSelectionController() {
       return document.docShell
         .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
         .getInterface(Components.interfaces.nsISelectionDisplay)
         .QueryInterface(Components.interfaces.nsISelectionController);
     }
 
     function isCaretVisible() {
-      netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
       window.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
       var docShell = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                             .getInterface(Components.interfaces.nsIWebNavigation)
                             .QueryInterface(Components.interfaces.nsIDocShell);
       var selCon = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
         .getInterface(Components.interfaces.nsISelectionDisplay)
         .QueryInterface(Components.interfaces.nsISelectionController);
       return selCon.caretVisible;
rename from layout/base/tests/test_reftests_with_caret.html
rename to layout/base/tests/chrome/test_reftests_with_caret.html
--- a/layout/base/tests/test_reftests_with_caret.html
+++ b/layout/base/tests/chrome/test_reftests_with_caret.html
@@ -1,17 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Reftests with caret drawing</title>
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+  <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
   <style>
     iframe {
       width: 600px;
       height: 600px;
     }
   </style>
 <script type="text/javascript">
 
@@ -79,18 +79,16 @@ function createIframe(url,next) {
 
 function refTest(test,ref) {
   createIframe(test,ref);
 };
 
 var caretBlinkTime = null;
 function endTest() {
   SimpleTest.finish();
-  netscape.security.PrivilegeManager.enablePrivilege(
-   'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
                         .getService(Components.interfaces.nsIPrefBranch);
   if (caretBlinkTime !== null) {
     prefs.setIntPref("ui.caretBlinkTime", caretBlinkTime);
   } else {
     prefs.clearUserPref("ui.caretBlinkTime");
   }
 }
@@ -120,24 +118,29 @@ var tests = [
     [ 'bug613433-3.html' , 'bug613433-ref.html' ] ,
     [ 'bug613807-1.html' , 'bug613807-1-ref.html' ] ,
     [ 'bug632215-1.html' , 'bug632215-ref.html'   ] ,
     [ 'bug632215-2.html' , 'bug632215-ref.html'   ] ,
     [ 'bug633044-1.html' , 'bug633044-1-ref.html' ] ,
     [ 'bug634406-1.html' , 'bug634406-1-ref.html' ] ,
     [ 'bug644428-1.html' , 'bug644428-1-ref.html' ] ,
     function() {
-      SpecialPowers.setBoolPref("bidi.browser.ui", true);
+      var prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                            .getService(Components.interfaces.nsIPrefBranch);
+      prefs.setBoolPref("bidi.browser.ui", true);
     },
     [ 'bug646382-1.html' , 'bug646382-1-ref.html' ] ,
     [ 'bug646382-2.html' , 'bug646382-2-ref.html' ] ,
     function() {
-      SpecialPowers.clearUserPref("bidi.browser.ui");
+      var prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                            .getService(Components.interfaces.nsIPrefBranch);
+      prefs.clearUserPref("bidi.browser.ui");
     },
 ];
+
 var testIndex = 0;
 
 function nextTest() {
   if (testIndex < tests.length) {
     if (typeof(tests[testIndex]) == 'function') {
       tests[testIndex]();
       SimpleTest.executeSoon(nextTest);
     } else {
@@ -146,21 +149,19 @@ function nextTest() {
     ++testIndex;
   } else {
     endTest();
   }
 }
 function runTests() {
   try {
     SimpleTest.waitForExplicitFinish();
-
-    netscape.security.PrivilegeManager.enablePrivilege(
-      'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
     var prefs = Components.classes["@mozilla.org/preferences-service;1"]
                           .getService(Components.interfaces.nsIPrefBranch);
+
     try {
       caretBlinkTime = prefs.getIntPref("ui.caretBlinkTime");
     } catch (e) {}
     prefs.setIntPref("ui.caretBlinkTime", -1);
 
     nextTest();
   } catch(e) {
     endTest();