1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/metro/base/tests/mochitest/browser_flyouts.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*- 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +"use strict"; 1.10 + 1.11 +gTests.push({ 1.12 + desc: "about flyout hides navbar, clears navbar selection, doesn't leak", 1.13 + run: function() { 1.14 + yield showNavBar(); 1.15 + 1.16 + let edit = document.getElementById("urlbar-edit"); 1.17 + edit.value = "http://www.wikipedia.org/"; 1.18 + 1.19 + sendElementTap(window, edit); 1.20 + 1.21 + yield waitForCondition(function () { 1.22 + return SelectionHelperUI.isSelectionUIVisible; 1.23 + }); 1.24 + ok(ContextUI.navbarVisible, "nav bar visible"); 1.25 + 1.26 + let promise = waitForEvent(FlyoutPanelsUI.AboutFlyoutPanel._topmostElement, "transitionend"); 1.27 + FlyoutPanelsUI.show('AboutFlyoutPanel'); 1.28 + yield promise; 1.29 + 1.30 + yield waitForCondition(function () { 1.31 + return !SelectionHelperUI.isSelectionUIVisible; 1.32 + }); 1.33 + ok(!ContextUI.navbarVisible, "nav bar hidden"); 1.34 + 1.35 + promise = waitForEvent(FlyoutPanelsUI.AboutFlyoutPanel._topmostElement, "transitionend"); 1.36 + FlyoutPanelsUI.hide('AboutFlyoutPanel'); 1.37 + yield promise; 1.38 + } 1.39 +}); 1.40 + 1.41 +function test() { 1.42 + if (!isLandscapeMode()) { 1.43 + todo(false, "browser_selection_tests need landscape mode to run."); 1.44 + return; 1.45 + } 1.46 + runTests(); 1.47 +}