Bug 892413 - Followup fixes for bug 887605, r=harth

This commit is contained in:
Victor Porof 2013-07-11 13:00:34 +03:00
Родитель 9703c4fe23
Коммит d4123b08f8
3 изменённых файлов: 14 добавлений и 11 удалений

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

@ -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);
}
});
}