1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-27 13:28:54 +00:00
Files
UXP/devtools/client/framework/test/browser_keybindings_03.js
T
Moonchild 8c395520d9 Issue #1656 - Part 1: Nuke most vim config lines in the tree.
Since these are just interpreted comments, there's 0 impact on actual code.
This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are
a few others scattered around which will be removed manually in a second part.
2020-09-25 22:04:12 +08:00

53 lines
1.7 KiB
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the toolbox 'switch to previous host' feature works.
// Pressing ctrl/cmd+shift+d should switch to the last used host.
const URL = "data:text/html;charset=utf8,test page for toolbox switching";
var {Toolbox} = require("devtools/client/framework/toolbox");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/client/locales/toolbox.properties");
add_task(function* () {
info("Create a test tab and open the toolbox");
let tab = yield addTab(URL);
let target = TargetFactory.forTab(tab);
let toolbox = yield gDevTools.showToolbox(target, "webconsole");
let shortcut = L10N.getStr("toolbox.toggleHost.key");
let {SIDE, BOTTOM, WINDOW} = Toolbox.HostType;
checkHostType(toolbox, BOTTOM, SIDE);
info("Switching from bottom to side");
let onHostChanged = toolbox.once("host-changed");
synthesizeKeyShortcut(shortcut, toolbox.win);
yield onHostChanged;
checkHostType(toolbox, SIDE, BOTTOM);
info("Switching from side to bottom");
onHostChanged = toolbox.once("host-changed");
synthesizeKeyShortcut(shortcut, toolbox.win);
yield onHostChanged;
checkHostType(toolbox, BOTTOM, SIDE);
info("Switching to window");
yield toolbox.switchHost(WINDOW);
checkHostType(toolbox, WINDOW, BOTTOM);
info("Switching from window to bottom");
onHostChanged = toolbox.once("host-changed");
synthesizeKeyShortcut(shortcut, toolbox.win);
yield onHostChanged;
checkHostType(toolbox, BOTTOM, WINDOW);
yield toolbox.destroy();
gBrowser.removeCurrentTab();
});