Bug 892413 - Followup fixes for bug 887605, r=harth
authorVictor Porof <vporof@mozilla.com>
Thu, 11 Jul 2013 13:00:34 +0300
changeset 139291 11d1d03a247f916c740c7a407a7b21c5889fb693
parent 139290 7d182fb1c981f04dcdc6588599b5b1a3f511a1df
child 139292 dad6d29417803cb148da36faff2a17d2b58ffb34
push id24984
push userttaubert@mozilla.com
push dateSat, 20 Jul 2013 07:34:04 +0000
treeherdermozilla-central@bf73e10f5e54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersharth
bugs892413, 887605
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 892413 - Followup fixes for bug 887605, r=harth
browser/devtools/netmonitor/netmonitor-controller.js
browser/devtools/netmonitor/netmonitor-view.js
browser/devtools/netmonitor/test/browser_net_copy_url.js
--- a/browser/devtools/netmonitor/netmonitor-controller.js
+++ b/browser/devtools/netmonitor/netmonitor-controller.js
@@ -18,18 +18,17 @@ Cu.import("resource:///modules/devtools/
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
   "resource://gre/modules/PluralForm.jsm");
 
 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" ];
 const NET_PREFS = { "NetworkMonitor.saveRequestAndResponseBodies": true };
 
 /**
  * Object defining the network monitor controller components.
  */
--- a/browser/devtools/netmonitor/netmonitor-view.js
+++ b/browser/devtools/netmonitor/netmonitor-view.js
@@ -363,17 +363,17 @@ RequestsMenuView.prototype = Heritage.ex
   },
 
   /**
    * Copy the request url from the currently selected item.
    */
   copyUrl: function() {
     let selected = this.selectedItem.attachment;
 
-    clipboardHelper.copyString(selected.url, this.document);
+    clipboardHelper.copyString(selected.url, document);
   },
 
   /**
    * Send a new HTTP request using the data in the custom request form.
    */
   sendCustomRequest: function() {
     let selected = this.selectedItem.attachment;
 
--- a/browser/devtools/netmonitor/test/browser_net_copy_url.js
+++ b/browser/devtools/netmonitor/test/browser_net_copy_url.js
@@ -7,26 +7,30 @@
 
 function test() {
   initNetMonitor(CUSTOM_GET_URL).then(([aTab, aDebuggee, aMonitor]) => {
     info("Starting test... ");
 
     let { NetMonitorView } = aMonitor.panelWin;
     let { RequestsMenu } = NetMonitorView;
 
-    RequestsMenu.lazyUpdate = false;
+    waitForNetworkEvents(aMonitor, 1).then(() => {
+      let requestItem = RequestsMenu.getItemAtIndex(0);
+      RequestsMenu.selectedItem = requestItem;
 
-    waitForNetworkEvents(aMonitor, 1).then(() => {
-      let imageRequest = RequestsMenu.getItemAtIndex(0);
-      RequestsMenu.selectedItem = imageRequest;
-
-      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);
     }
   });
 }
-