browser/components/tabview/test/browser_tabview_bug618816.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function test() {
     5   let cw;
     6   let win;
     8   let testFocusTitle = function () {
     9     let title = 'title';
    10     let groupItem = cw.GroupItems.groupItems[0];
    11     groupItem.setTitle(title);
    13     let target = groupItem.$titleShield[0];
    14     EventUtils.synthesizeMouseAtCenter(target, {}, cw);
    16     let input = groupItem.$title[0];
    17     is(input.selectionStart, 0, 'the whole text is selected');
    18     is(input.selectionEnd, title.length, 'the whole text is selected');
    20     EventUtils.synthesizeMouseAtCenter(input, {}, cw);
    21     is(input.selectionStart, title.length, 'caret is at the rightmost position and no text is selected');
    22     is(input.selectionEnd, title.length, 'caret is at the rightmost position and no text is selected');
    24     win.close();
    25     finish();
    26   }
    28   waitForExplicitFinish();
    30   newWindowWithTabView(function (tvwin) {
    31     win = tvwin;
    33     registerCleanupFunction(function () {
    34       if (!win.closed)
    35         win.close();
    36     });
    38     cw = win.TabView.getContentWindow();
    39     SimpleTest.waitForFocus(testFocusTitle, cw);
    40   });
    41 }

mercurial