Bug 1269209 - Port test_bug830600.html from chrome to plain; r=masayuki
☠☠ backed out by 177bf2e81f96 ☠ ☠
authorAryeh Gregor <ayg@aryeh.name>
Mon, 22 Aug 2016 21:17:49 +0300
changeset 319742 bc025cccc7fbf04d5216c87d0e4864f88eeacc67
parent 319741 016b31e0631f29a0a22ed8c6f3bc627a6dc973df
child 319743 dc9d739edd0ff7b694c2bb98da9b0ffb2fcdea9d
push id20748
push userphilringnalda@gmail.com
push dateFri, 28 Oct 2016 03:39:55 +0000
treeherderfx-team@715360440695 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1269209, 830600
milestone52.0a1
Bug 1269209 - Port test_bug830600.html from chrome to plain; r=masayuki Fails in e10s. mrbkap said he has no idea why without debugging it (comment 8 in bug). MozReview-Commit-ID: 6vG0czg6Vpv
editor/libeditor/tests/chrome.ini
editor/libeditor/tests/mochitest.ini
editor/libeditor/tests/test_bug830600.html
--- a/editor/libeditor/tests/chrome.ini
+++ b/editor/libeditor/tests/chrome.ini
@@ -9,18 +9,16 @@ subsuite = clipboard
 skip-if = buildapp == 'mulet'
 [test_bug599983.xul]
 skip-if = buildapp == 'mulet'
 [test_bug607584.xul]
 [test_bug616590.xul]
 [test_bug636465.xul]
 [test_bug646194.xul]
 [test_bug780908.xul]
-[test_bug830600.html]
-subsuite = clipboard
 [test_bug1053048.html]
 [test_bug1100966.html]
 [test_bug1102906.html]
 [test_bug1101392.html]
 subsuite = clipboard
 [test_bug1140105.html]
 [test_bug1140617.xul]
 subsuite = clipboard
--- a/editor/libeditor/tests/mochitest.ini
+++ b/editor/libeditor/tests/mochitest.ini
@@ -147,16 +147,19 @@ subsuite = clipboard
 [test_bug767684.html]
 [test_bug772796.html]
 [test_bug773262.html]
 [test_bug780035.html]
 [test_bug787432.html]
 [test_bug790475.html]
 [test_bug795785.html]
 [test_bug796839.html]
+[test_bug830600.html]
+subsuite = clipboard
+skip-if = e10s
 [test_bug832025.html]
 [test_bug850043.html]
 [test_bug857487.html]
 [test_bug858918.html]
 [test_bug915962.html]
 [test_bug974309.html]
 skip-if = toolkit == 'android'
 [test_bug966155.html]
--- a/editor/libeditor/tests/test_bug830600.html
+++ b/editor/libeditor/tests/test_bug830600.html
@@ -3,48 +3,47 @@
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=830600
 -->
 <head>
   <title>Test for Bug 830600</title>
-  <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>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+  <script src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script src="/tests/SimpleTest/EventUtils.js"></script>
+  <link rel="stylesheet" href="/tests/SimpleTest/test.css">
 </head>
 
 <body>
   <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=830600">Mozilla Bug 830600</a>
   <p id="display"></p>
   <div id="content" style="display: none">
   </div>
   <input type="text" id="t1" />
   <pre id="test">
     <script type="application/javascript;version=1.7">
 
       /** Test for Bug 830600 **/
       SimpleTest.waitForExplicitFinish();
       SimpleTest.waitForFocus(function() {
-        const Ci = Components.interfaces;
+        const Ci = SpecialPowers.Ci;
         function test(str, expected, callback) {
           var t = document.getElementById("t1");
-          t.QueryInterface(Ci.nsIDOMNSEditableElement);
+          SpecialPowers.wrap(t).QueryInterface(Ci.nsIDOMNSEditableElement);
           t.focus();
           t.value = "";
-          t.editor.QueryInterface(Ci.nsIPlaintextEditor);
-          var origNewlineHandling = t.editor.newlineHandling;
-          t.editor.newlineHandling = Ci.nsIPlaintextEditor.eNewlinesStripSurroundingWhitespace
+          var editor = SpecialPowers.wrap(t).editor;
+          editor.QueryInterface(Ci.nsIPlaintextEditor);
+          var origNewlineHandling = editor.newlineHandling;
+          editor.newlineHandling = Ci.nsIPlaintextEditor.eNewlinesStripSurroundingWhitespace
           SimpleTest.waitForClipboard(str,
             function() {
-              Components.classes["@mozilla.org/widget/clipboardhelper;1"]
-                        .getService(Components.interfaces.nsIClipboardHelper)
+              SpecialPowers.Cc["@mozilla.org/widget/clipboardhelper;1"]
+                        .getService(Ci.nsIClipboardHelper)
                         .copyString(str);
             },
             function() {
               synthesizeKey("V", {accelKey: true});
               is(t.value, expected, "New line handling works correctly");
               t.value = "";
               callback();
             },