Backed out changeset 11a9cb8e8200 (bug 1446671) for ES Linting opt failures on accessible/tests/browser/events/browser_test_textcaret.js on a CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Thu, 12 Apr 2018 04:35:22 +0300
changeset 412915 66b410a96377731772528526772b0b590a698186
parent 412914 b4dcb47b854282d4e439f678c79fc2527a215c0d
child 412916 fbbc76f40fcc2dce6492a7edf260f101cab110e2
push id33824
push userebalazs@mozilla.com
push dateThu, 12 Apr 2018 09:39:57 +0000
treeherdermozilla-central@246c614e1605 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1446671
milestone61.0a1
backs out11a9cb8e82005c66878a623aee55426babf63f65
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 11a9cb8e8200 (bug 1446671) for ES Linting opt failures on accessible/tests/browser/events/browser_test_textcaret.js on a CLOSED TREE
accessible/tests/browser/events/browser.ini
accessible/tests/browser/events/browser_test_textcaret.js
accessible/tests/mochitest/textcaret/a11y.ini
accessible/tests/mochitest/textcaret/test_browserui.xul
testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
--- a/accessible/tests/browser/events/browser.ini
+++ b/accessible/tests/browser/events/browser.ini
@@ -2,11 +2,10 @@
 support-files =
   head.js
   !/accessible/tests/browser/events.js
   !/accessible/tests/browser/shared-head.js
   !/accessible/tests/mochitest/*.js
 
 [browser_test_docload.js]
 skip-if = e10s
-[browser_test_textcaret.js]
 [browser_test_focus_browserui.js]
 [browser_test_focus_dialog.js]
deleted file mode 100644
--- a/accessible/tests/browser/events/browser_test_textcaret.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * Caret move events checker.
- */
-function caretMoveChecker(target, caretOffset) {
-  return function(event) {
-    let cmEvent = event.QueryInterface(nsIAccessibleCaretMoveEvent);
-    return cmEvent.accessible == getAccessible(target) && cmEvent.caretOffset == caretOffset;
-  };
-}
-
-async function checkURLBarCaretEvents() {
-  let url = "about:mozilla";
-
-  let onDocLoad = waitForEvent(
-    EVENT_DOCUMENT_LOAD_COMPLETE,
-    event => {
-      try { return event.accessible.QueryInterface(nsIAccessibleDocument).URL == url; }
-      catch(e) { return false; }
-    }
-  );
-  let [ newWin ] = await Promise.all([
-    BrowserTestUtils.openNewBrowserWindow({ url }),
-    onDocLoad
-  ]);
-
-  let urlbarInputEl = newWin.document.getElementById("urlbar").inputField;
-  let urlbarInput = getAccessible(urlbarInputEl, [ nsIAccessibleText ]);
-
-  let onCaretMove = waitForEvents([
-    [ EVENT_TEXT_CARET_MOVED, caretMoveChecker(urlbarInput, url.length) ],
-    [ EVENT_FOCUS, urlbarInput ]
-  ]);
-
-  urlbarInput.caretOffset = -1;
-  await onCaretMove;
-  ok(true, "Caret move in URL bar #1");
-
-  onCaretMove = waitForEvent(
-    EVENT_TEXT_CARET_MOVED, caretMoveChecker(urlbarInput, 0)
-  );
-
-  urlbarInput.caretOffset = 0;
-  await onCaretMove;
-  ok(true, "Caret move in URL bar #2");
-
-  await BrowserTestUtils.closeWindow(newWin);
-}
-
-add_task(checkURLBarCaretEvents);
--- a/accessible/tests/mochitest/textcaret/a11y.ini
+++ b/accessible/tests/mochitest/textcaret/a11y.ini
@@ -1,5 +1,6 @@
 [DEFAULT]
 support-files =
   !/accessible/tests/mochitest/*.js
 
+[test_browserui.xul]
 [test_general.html]
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/textcaret/test_browserui.xul
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="Accessibility Caret Offset Test.">
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../role.js"></script>
+  <script type="application/javascript"
+          src="../states.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+  <script type="application/javascript"
+          src="../browser.js"></script>
+
+  <script type="application/javascript">
+  <![CDATA[
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Tests
+
+    gA11yEventDumpToConsole = true; // debug
+    //enableLogging("tree,verbose");
+
+    var gQueue = null;
+    function doTests()
+    {
+      gQueue = new eventQueue();
+      gQueue.push(new setCaretOffset(urlbarInput(), -1, urlbarInput()));
+      gQueue.push(new setCaretOffset(urlbarInput(), 0));
+      gQueue.onFinish = function()
+      {
+        closeBrowserWindow();
+      }
+
+      gQueue.invoke();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    openBrowserWindow(doTests, "about:mozilla");
+  ]]>
+  </script>
+
+  <vbox flex="1" style="overflow: auto;">
+  <body xmlns="http://www.w3.org/1999/xhtml">
+    <a target="_blank"
+       href="https://bugzilla.mozilla.org/show_bug.cgi?id=723833"
+       title="IAccessibleText::setCaretOffset on location or search bar causes focus to jump">
+      Bug 723833
+    </a>
+    <p id="display"></p>
+    <div id="content" style="display: none">
+    </div>
+    <pre id="test">
+    </pre>
+  </body>
+  </vbox>
+</window>
--- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
+++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
@@ -695,20 +695,16 @@ var BrowserTestUtils = {
       features += ",top=" + options.top;
     }
 
     if (options.hasOwnProperty("remote")) {
       let remoteState = options.remote ? "remote" : "non-remote";
       features += `,${remoteState}`;
     }
 
-    if (options.url) {
-      argString.data = options.url;
-    }
-
     let win = Services.ww.openWindow(
       opener, Services.prefs.getCharPref("browser.chromeURL"), "_blank",
       features, argString);
 
     // Wait for browser-delayed-startup-finished notification, it indicates
     // that the window has loaded completely and is ready to be used for
     // testing.
     let startupPromise =