browser/metro/base/tests/mochitest/browser_flyouts.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 "use strict";
     8 gTests.push({
     9   desc: "about flyout hides navbar, clears navbar selection, doesn't leak",
    10   run: function() {
    11     yield showNavBar();
    13     let edit = document.getElementById("urlbar-edit");
    14     edit.value = "http://www.wikipedia.org/";
    16     sendElementTap(window, edit);
    18     yield waitForCondition(function () {
    19       return SelectionHelperUI.isSelectionUIVisible;
    20     });
    21     ok(ContextUI.navbarVisible, "nav bar visible");
    23     let promise = waitForEvent(FlyoutPanelsUI.AboutFlyoutPanel._topmostElement, "transitionend");
    24     FlyoutPanelsUI.show('AboutFlyoutPanel');
    25     yield promise;
    27     yield waitForCondition(function () {
    28       return !SelectionHelperUI.isSelectionUIVisible;
    29     });
    30     ok(!ContextUI.navbarVisible, "nav bar hidden");
    32     promise = waitForEvent(FlyoutPanelsUI.AboutFlyoutPanel._topmostElement, "transitionend");
    33     FlyoutPanelsUI.hide('AboutFlyoutPanel');
    34     yield promise;
    35   }
    36 });
    38 function test() {
    39   if (!isLandscapeMode()) {
    40     todo(false, "browser_selection_tests need landscape mode to run.");
    41     return;
    42   }
    43   runTests();
    44 }

mercurial