Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 /**
5 * Tests if copying a request's url works.
6 */
8 function test() {
9 initNetMonitor(CUSTOM_GET_URL).then(([aTab, aDebuggee, aMonitor]) => {
10 info("Starting test... ");
12 let { NetMonitorView } = aMonitor.panelWin;
13 let { RequestsMenu } = NetMonitorView;
15 waitForNetworkEvents(aMonitor, 1).then(() => {
16 let requestItem = RequestsMenu.getItemAtIndex(0);
17 RequestsMenu.selectedItem = requestItem;
19 waitForClipboard(requestItem.attachment.url, function setup() {
20 RequestsMenu.copyUrl();
21 }, function onSuccess() {
22 ok(true, "Clipboard contains the currently selected item's url.");
23 cleanUp();
24 }, function onFailure() {
25 ok(false, "Copying the currently selected item's url was unsuccessful.");
26 cleanUp();
27 });
28 });
30 aDebuggee.performRequests(1);
32 function cleanUp(){
33 teardown(aMonitor).then(finish);
34 }
35 });
36 }