2011-02-02 17:20:01 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
let cw;
|
2011-04-07 13:13:05 -07:00
|
|
|
let win;
|
2011-02-02 17:20:01 -08:00
|
|
|
|
|
|
|
let testFocusTitle = function () {
|
|
|
|
let title = 'title';
|
2011-04-07 13:13:05 -07:00
|
|
|
let groupItem = cw.GroupItems.groupItems[0];
|
2011-02-02 17:20:01 -08:00
|
|
|
groupItem.setTitle(title);
|
|
|
|
|
|
|
|
let target = groupItem.$titleShield[0];
|
|
|
|
EventUtils.synthesizeMouseAtCenter(target, {}, cw);
|
|
|
|
|
|
|
|
let input = groupItem.$title[0];
|
|
|
|
is(input.selectionStart, 0, 'the whole text is selected');
|
|
|
|
is(input.selectionEnd, title.length, 'the whole text is selected');
|
|
|
|
|
|
|
|
EventUtils.synthesizeMouseAtCenter(input, {}, cw);
|
|
|
|
is(input.selectionStart, title.length, 'caret is at the rightmost position and no text is selected');
|
|
|
|
is(input.selectionEnd, title.length, 'caret is at the rightmost position and no text is selected');
|
|
|
|
|
2011-04-07 13:13:05 -07:00
|
|
|
win.close();
|
|
|
|
finish();
|
2011-02-02 17:20:01 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
2011-04-07 13:13:05 -07:00
|
|
|
newWindowWithTabView(function (tvwin) {
|
|
|
|
win = tvwin;
|
|
|
|
|
|
|
|
registerCleanupFunction(function () {
|
|
|
|
if (!win.closed)
|
|
|
|
win.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
cw = win.TabView.getContentWindow();
|
|
|
|
SimpleTest.waitForFocus(testFocusTitle, cw);
|
2011-02-02 17:20:01 -08:00
|
|
|
});
|
|
|
|
}
|