Bug 1388954: Remove usages of deprecated SDK modules in DAMP tests. r?bgrins draft
authorKris Maglione <maglione.k@gmail.com>
Wed, 09 Aug 2017 19:39:32 -0700
changeset 643740 f88793b9aebedbf22046187aa771fc4afe2c5d8e
parent 643739 c3108aebee35c4fc2ac04ea19fd17534bf606d64
child 725386 e76d5edc3eeee6443917bfdea256172fcfd93289
push id73195
push usermaglione.k@gmail.com
push dateThu, 10 Aug 2017 02:39:51 +0000
reviewersbgrins
bugs1388954
milestone57.0a1
Bug 1388954: Remove usages of deprecated SDK modules in DAMP tests. r?bgrins MozReview-Commit-ID: EqkHiEX2PNr
testing/talos/talos/tests/devtools/addon/content/damp.js
--- a/testing/talos/talos/tests/devtools/addon/content/damp.js
+++ b/testing/talos/talos/tests/devtools/addon/content/damp.js
@@ -1,24 +1,30 @@
 Components.utils.import("resource://devtools/client/framework/gDevTools.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 const { devtools } =
   Components.utils.import("resource://devtools/shared/Loader.jsm", {});
-const { getActiveTab } = devtools.require("sdk/tabs/utils");
-const { getMostRecentBrowserWindow } = devtools.require("sdk/window/utils");
 const ThreadSafeChromeUtils = devtools.require("ThreadSafeChromeUtils");
 const { EVENTS } = devtools.require("devtools/client/netmonitor/src/constants");
 const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 const webserver = Services.prefs.getCharPref("addon.test.damp.webserver");
 
 const SIMPLE_URL = webserver + "/tests/devtools/addon/content/pages/simple.html";
 const COMPLICATED_URL = webserver + "/tests/tp5n/bild.de/www.bild.de/index.html";
 
+function getMostRecentBrowserWindow() {
+  return Services.wm.getMostRecentWindow("navigator:browser");
+}
+
+function getActiveTab(window) {
+  return window.gBrowser.selectedTab;
+}
+
 /* globals res:true */
 
 function Damp() {
   // Path to the temp file where the heap snapshot file is saved. Set by
   // saveHeapSnapshot and read by readHeapSnapshot.
   this._heapSnapshotFilePath = null;
   // HeapSnapshot instance. Set by readHeapSnapshot, used by takeCensus.
   this._snapshot = null;