зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 090f4e5a8d73 (bug 1446671) For failing Test verify on accessible/tests/browser/events/browser_test_textcaret.js on a CLOSED TREE
This commit is contained in:
Родитель
f7c08a2145
Коммит
50132b1765
|
@ -7,6 +7,5 @@ support-files =
|
|||
|
||||
[browser_test_docload.js]
|
||||
skip-if = e10s
|
||||
[browser_test_textcaret.js]
|
||||
[browser_test_focus_browserui.js]
|
||||
[browser_test_focus_dialog.js]
|
||||
|
|
|
@ -1,43 +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 newWin = await BrowserTestUtils.openNewBrowserWindow({ url });
|
||||
|
||||
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);
|
|
@ -2,4 +2,5 @@
|
|||
support-files =
|
||||
!/accessible/tests/mochitest/*.js
|
||||
|
||||
[test_browserui.xul]
|
||||
[test_general.html]
|
||||
|
|
|
@ -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>
|
|
@ -700,10 +700,6 @@ var BrowserTestUtils = {
|
|||
features += `,${remoteState}`;
|
||||
}
|
||||
|
||||
if (options.url) {
|
||||
argString.data = options.url;
|
||||
}
|
||||
|
||||
let win = Services.ww.openWindow(
|
||||
opener, Services.prefs.getCharPref("browser.chromeURL"), "_blank",
|
||||
features, argString);
|
||||
|
|
Загрузка…
Ссылка в новой задаче