зеркало из https://github.com/mozilla/gecko-dev.git
Bug 892413 - Followup fixes for bug 887605, r=harth
This commit is contained in:
Родитель
9703c4fe23
Коммит
d4123b08f8
|
@ -23,8 +23,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "NetworkHelper",
|
|||
"resource://gre/modules/devtools/NetworkHelper.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "clipboardHelper",
|
||||
"@mozilla.org/widget/clipboardhelper;1",
|
||||
"nsIClipboardHelper");
|
||||
"@mozilla.org/widget/clipboardhelper;1", "nsIClipboardHelper");
|
||||
|
||||
const NET_STRINGS_URI = "chrome://browser/locale/devtools/netmonitor.properties";
|
||||
const LISTENERS = [ "NetworkActivity" ];
|
||||
|
|
|
@ -368,7 +368,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
|
|||
copyUrl: function() {
|
||||
let selected = this.selectedItem.attachment;
|
||||
|
||||
clipboardHelper.copyString(selected.url, this.document);
|
||||
clipboardHelper.copyString(selected.url, document);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,21 +12,25 @@ function test() {
|
|||
let { NetMonitorView } = aMonitor.panelWin;
|
||||
let { RequestsMenu } = NetMonitorView;
|
||||
|
||||
RequestsMenu.lazyUpdate = false;
|
||||
|
||||
waitForNetworkEvents(aMonitor, 1).then(() => {
|
||||
let imageRequest = RequestsMenu.getItemAtIndex(0);
|
||||
RequestsMenu.selectedItem = imageRequest;
|
||||
let requestItem = RequestsMenu.getItemAtIndex(0);
|
||||
RequestsMenu.selectedItem = requestItem;
|
||||
|
||||
waitForClipboard(RequestsMenu.selectedItem.attachment.url, function(){ RequestsMenu.copyUrl() } , cleanUp, cleanUp);
|
||||
waitForClipboard(requestItem.attachment.url, function setup() {
|
||||
RequestsMenu.copyUrl();
|
||||
}, function onSuccess() {
|
||||
ok(true, "Clipboard contains the currently selected item's url.");
|
||||
cleanUp();
|
||||
}, function onFailure() {
|
||||
ok(false, "Copying the currently selected item's url was unsuccessful.");
|
||||
cleanUp();
|
||||
});
|
||||
});
|
||||
|
||||
aDebuggee.performRequests(1);
|
||||
|
||||
function cleanUp(){
|
||||
teardown(aMonitor);
|
||||
finish();
|
||||
teardown(aMonitor).then(finish);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче