Bug 1271120 - Port test_composition_event_created_in_chrome.html from chrome to plain; r=masayuki
authorAryeh Gregor <ayg@aryeh.name>
Tue, 23 Aug 2016 16:01:28 +0300
changeset 432282 1334f6bb2ea03f9449dbc2319e1add4a9f972cd5
parent 432281 e688081176ae94c102b4213516a7f43cbd9455bf
child 432283 fe1a0812871c3e44645180330534a4292a56ebae
push id34240
push userbmo:ttromey@mozilla.com
push dateTue, 01 Nov 2016 14:41:32 +0000
reviewersmasayuki
bugs1271120
milestone52.0a1
Bug 1271120 - Port test_composition_event_created_in_chrome.html from chrome to plain; r=masayuki MozReview-Commit-ID: 5K2qv7JXAT4
editor/libeditor/tests/chrome.ini
editor/libeditor/tests/mochitest.ini
editor/libeditor/tests/test_composition_event_created_in_chrome.html
--- a/editor/libeditor/tests/chrome.ini
+++ b/editor/libeditor/tests/chrome.ini
@@ -7,16 +7,15 @@ support-files = green.png
 skip-if = buildapp == 'mulet'
 [test_bug599983.xul]
 skip-if = buildapp == 'mulet'
 [test_bug607584.xul]
 [test_bug616590.xul]
 [test_bug636465.xul]
 [test_bug780908.xul]
 [test_bug1102906.html]
-[test_composition_event_created_in_chrome.html]
 [test_contenteditable_text_input_handling.html]
 [test_dragdrop.html]
 skip-if = buildapp == 'mulet'
 [test_htmleditor_keyevent_handling.html]
 [test_set_document_title_transaction.html]
 [test_texteditor_keyevent_handling.html]
 skip-if = (debug && os=='win') || (os == 'linux') # Bug 1116205, leaks on windows debug, fails delete key on linux
--- a/editor/libeditor/tests/mochitest.ini
+++ b/editor/libeditor/tests/mochitest.ini
@@ -201,16 +201,17 @@ skip-if = toolkit == 'android'
 [test_bug1250010.html]
 [test_bug1257363.html]
 [test_bug1248185.html]
 [test_bug1258085.html]
 [test_bug1268736.html]
 
 [test_CF_HTML_clipboard.html]
 subsuite = clipboard
+[test_composition_event_created_in_chrome.html]
 [test_contenteditable_focus.html]
 [test_dom_input_event_on_htmleditor.html]
 skip-if = toolkit == 'android' # bug 1054087
 [test_dom_input_event_on_texteditor.html]
 [test_keypress_untrusted_event.html]
 [test_root_element_replacement.html]
 [test_select_all_without_body.html]
 [test_spellcheck_pref.html]
--- a/editor/libeditor/tests/test_composition_event_created_in_chrome.html
+++ b/editor/libeditor/tests/test_composition_event_created_in_chrome.html
@@ -1,38 +1,36 @@
+<!doctype html>
 <html>
 
 <head>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+  <link rel="stylesheet" href="/tests/SimpleTest/test.css">
 
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
+  <script src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script src="/tests/SimpleTest/EventUtils.js"></script>
 </head>
 
 <body>
 
 <input id="input">
 
 <script type="application/javascript">
 
 // In nsEditorEventListener, when listening event is not created with proper
 // event interface, it asserts the fact.
-SimpleTest.expectAssertions(2);
 SimpleTest.waitForExplicitFinish();
 
 var gInputElement = document.getElementById("input");
 
 function getEditorIMESupport(aInputElement)
 {
-  var editableElement = aInputElement.QueryInterface(Components.interfaces.nsIDOMNSEditableElement);
+  var editableElement = SpecialPowers.wrap(aInputElement).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement);
   ok(editableElement, "The input element doesn't have nsIDOMNSEditableElement interface");
   ok(editableElement.editor, "There is no editor for the input element");
-  var editorIMESupport = editableElement.editor.QueryInterface(Components.interfaces.nsIEditorIMESupport);
+  var editorIMESupport = SpecialPowers.wrap(editableElement).editor.QueryInterface(SpecialPowers.Ci.nsIEditorIMESupport);
   ok(editorIMESupport, "The input element doesn't have nsIEditorIMESupport interface");
   return editorIMESupport;
 }
 
 var gEditorIMESupport;
 
 function testNotGenerateCompositionByCreatedEvents(aEventInterface)
 {