Bug 841811 - Remove deprecated enablePrivilege from test added in bug 790475. r=ehsan.
authorMike Conley <mconley@mozilla.com>
Tue, 19 Feb 2013 10:29:30 -0500
changeset 128761 e5720e459a543ca76af7946779bbb0930dce0d08
parent 128760 878874218b31ff8b776103ad5cd20250d592febe
child 128762 126cfa64a877fee959468b1b75b5580ff7ad35d6
push id3582
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 20:50:56 +0000
treeherdermozilla-aurora@400370bbc9fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs841811, 790475
milestone21.0a1
Bug 841811 - Remove deprecated enablePrivilege from test added in bug 790475. r=ehsan.
editor/libeditor/html/tests/test_bug790475.html
--- a/editor/libeditor/html/tests/test_bug790475.html
+++ b/editor/libeditor/html/tests/test_bug790475.html
@@ -23,21 +23,22 @@ https://bugzilla.mozilla.org/show_bug.cg
  */
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(runTest);
 
 var gMisspeltWords;
 
 function getEditor() {
-  const Ci = Components.interfaces;
-  var editingSession = window.QueryInterface(Ci.nsIInterfaceRequestor)
-                             .getInterface(Ci.nsIWebNavigation)
-                             .QueryInterface(Ci.nsIInterfaceRequestor)
-                             .getInterface(Ci.nsIEditingSession);
+  const Ci = SpecialPowers.Ci;
+  var editingSession = SpecialPowers.wrap(window)
+                                    .QueryInterface(Ci.nsIInterfaceRequestor)
+                                    .getInterface(Ci.nsIWebNavigation)
+                                    .QueryInterface(Ci.nsIInterfaceRequestor)
+                                    .getInterface(Ci.nsIEditingSession);
   return editingSession.getEditorForWindow(window);
 }
 
 function getSpellCheckSelection() {
   var editor = getEditor();
   var selcon = editor.selectionController;
   return selcon.getSelection(selcon.SELECTION_SPELLCHECK);
 }
@@ -63,18 +64,16 @@ function runTest() {
     SimpleTest.executeSoon(function() {
       is(isSpellingCheckOk(), true, "Should not have found any misspellings. ");
       SimpleTest.finish();
     });
   });
 }
 
 function isSpellingCheckOk() {
-  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
   var sel = getSpellCheckSelection();
   var numWords = sel.rangeCount;
 
   is(numWords, gMisspeltWords.length, "Correct number of misspellings and words.");
 
   if (numWords != gMisspeltWords.length)
     return false;