browser/devtools/netmonitor/test/browser_net_copy_url.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 }

mercurial