|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /** |
|
5 * Tests if copying a request's url works. |
|
6 */ |
|
7 |
|
8 function test() { |
|
9 initNetMonitor(CUSTOM_GET_URL).then(([aTab, aDebuggee, aMonitor]) => { |
|
10 info("Starting test... "); |
|
11 |
|
12 let { NetMonitorView } = aMonitor.panelWin; |
|
13 let { RequestsMenu } = NetMonitorView; |
|
14 |
|
15 waitForNetworkEvents(aMonitor, 1).then(() => { |
|
16 let requestItem = RequestsMenu.getItemAtIndex(0); |
|
17 RequestsMenu.selectedItem = requestItem; |
|
18 |
|
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 }); |
|
29 |
|
30 aDebuggee.performRequests(1); |
|
31 |
|
32 function cleanUp(){ |
|
33 teardown(aMonitor).then(finish); |
|
34 } |
|
35 }); |
|
36 } |