Bug 848502 - Add keyboard shortcut to copy selected source URL. r=vporof

This commit is contained in:
Mike Taylor 2015-04-03 09:13:00 -04:00
Родитель 447077e35f
Коммит 5809ad205b
4 изменённых файлов: 41 добавлений и 0 удалений

Просмотреть файл

@ -253,6 +253,10 @@
key="&debuggerUI.removeAllWatch.key;"
modifiers="accel alt"
command="removeAllWatchExpressionsCommand"/>
<key id="debuggerSourcesCopyUrl"
key="&debuggerUI.context.copyUrl.key;"
modifiers="accel"
oncommand="DebuggerView.Sources._onCopyUrlCommand()"/>
</keyset>
<vbox id="body"

Просмотреть файл

@ -395,6 +395,7 @@ skip-if = e10s && debug
[browser_dbg_sources-eval-01.js]
skip-if = true # non-named eval sources turned off for now, bug 1124106
[browser_dbg_sources-eval-02.js]
[browser_dbg_sources-keybindings.js]
skip-if = e10s && debug
[browser_dbg_sources-labels.js]
skip-if = e10s && debug

Просмотреть файл

@ -0,0 +1,35 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests related to source panel keyboard shortcut bindings
*/
const TAB_URL = EXAMPLE_URL + "doc_function-search.html";
const SCRIPT_URI = EXAMPLE_URL + "code_function-search-01.js";
function test() {
let gTab, gPanel, gDebugger, gSources;
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
waitForSourceShown(gPanel, "-01.js")
.then(testCopyURLShortcut)
.then(() => closeDebuggerAndFinish(gPanel))
.then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
});
function testCopyURLShortcut() {
return waitForClipboardPromise(sendCopyShortcut, SCRIPT_URI);
}
function sendCopyShortcut() {
EventUtils.synthesizeKey("C", { accelKey: true }, gDebugger);
}
}

Просмотреть файл

@ -211,3 +211,4 @@
- the same as netmonitorUI.context.copyUrl -->
<!ENTITY debuggerUI.context.copyUrl "Copy URL">
<!ENTITY debuggerUI.context.copyUrl.accesskey "C">
<!ENTITY debuggerUI.context.copyUrl.key "C">