Bug 1271119 - Port test_bug1153237.html from chrome to plain; r=masayuki

MozReview-Commit-ID: DDfHuLwplBV
This commit is contained in:
Aryeh Gregor 2016-08-30 21:13:49 +03:00
Родитель 953f75ec49
Коммит 2459cda825
3 изменённых файлов: 8 добавлений и 14 удалений

Просмотреть файл

@ -12,7 +12,6 @@ skip-if = buildapp == 'mulet'
[test_bug636465.xul]
[test_bug780908.xul]
[test_bug1102906.html]
[test_bug1153237.html]
[test_bug1248128.html]
[test_bug1248185.html]
[test_composition_event_created_in_chrome.html]

Просмотреть файл

@ -187,6 +187,7 @@ subsuite = clipboard
[test_bug1140617.html]
subsuite = clipboard
skip-if = toolkit == 'android' # bug 1299578
[test_bug1153237.html]
[test_bug1154791.html]
skip-if = os == 'android'
[test_bug1162952.html]

Просмотреть файл

@ -6,8 +6,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1153237
<head>
<meta charset="utf-8">
<title>Test for Bug 1153237</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
@ -25,20 +25,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1153237
var sel = window.getSelection();
element.focus();
ok(sel.getRangeAt(0).startOffset == 0, "offset is zero");
is(sel.getRangeAt(0).startOffset, 0, "offset is zero");
const kSelectRight2 = "cmd_selectRight2";
var controller =
top.document.commandDispatcher.getControllerForCommand(kSelectRight2);
ok((controller && controller.isCommandEnabled(kSelectRight2)),
"have " + kSelectRight2 + " command");
controller.doCommand(kSelectRight2);
ok(sel.toString() == "Some ",
SpecialPowers.doCommand(window, "cmd_selectRight2");
is(sel.toString(), "Some ",
"first word + space is selected: got '" + sel.toString() + "'");
controller.doCommand(kSelectRight2);
ok(sel.toString() == "Some text",
SpecialPowers.doCommand(window, "cmd_selectRight2");
is(sel.toString(), "Some text",
"both words are selected: got '" + sel.toString() + "'");
SimpleTest.finish();