michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests if copying a request's url works. michael@0: */ michael@0: michael@0: function test() { michael@0: initNetMonitor(CUSTOM_GET_URL).then(([aTab, aDebuggee, aMonitor]) => { michael@0: info("Starting test... "); michael@0: michael@0: let { NetMonitorView } = aMonitor.panelWin; michael@0: let { RequestsMenu } = NetMonitorView; michael@0: michael@0: waitForNetworkEvents(aMonitor, 1).then(() => { michael@0: let requestItem = RequestsMenu.getItemAtIndex(0); michael@0: RequestsMenu.selectedItem = requestItem; michael@0: michael@0: waitForClipboard(requestItem.attachment.url, function setup() { michael@0: RequestsMenu.copyUrl(); michael@0: }, function onSuccess() { michael@0: ok(true, "Clipboard contains the currently selected item's url."); michael@0: cleanUp(); michael@0: }, function onFailure() { michael@0: ok(false, "Copying the currently selected item's url was unsuccessful."); michael@0: cleanUp(); michael@0: }); michael@0: }); michael@0: michael@0: aDebuggee.performRequests(1); michael@0: michael@0: function cleanUp(){ michael@0: teardown(aMonitor).then(finish); michael@0: } michael@0: }); michael@0: }