Bug 1456274 - Add target.makeRemote in several tests. r=ochameau
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 23 Apr 2018 19:18:59 -0500
changeset 471678 6c411b0781cc2f9fbf4c8b29dfc2cfa3af0b1301
parent 471677 08f354110a575209c603caa45be163ab27b8bc98
child 471679 205817abe4d5568b8ea1ecd72a7f3795804e10b3
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1456274
milestone61.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 1456274 - Add target.makeRemote in several tests. r=ochameau Navigation events now require a "remoted" target. Add `makeRemote` calls to a tests which make use of these features. MozReview-Commit-ID: GJsleBWryCd
devtools/client/framework/test/browser_target_events.js
devtools/server/tests/mochitest/test_framerate_04.html
--- a/devtools/client/framework/test/browser_target_events.js
+++ b/devtools/client/framework/test/browser_target_events.js
@@ -1,16 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 add_task(async function() {
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
   let target = TargetFactory.forTab(gBrowser.selectedTab);
+  await target.makeRemote();
   is(target.tab, gBrowser.selectedTab, "Target linked to the right tab.");
 
   let hidden = once(target, "hidden");
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   await hidden;
   ok(true, "Hidden event received");
 
   let visible = once(target, "visible");
--- a/devtools/server/tests/mochitest/test_framerate_04.html
+++ b/devtools/server/tests/mochitest/test_framerate_04.html
@@ -18,22 +18,23 @@ Bug 1023018 - Tests if the framerate act
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   const {FramerateFront} = require("devtools/shared/fronts/framerate");
   const {TargetFactory} = require("devtools/client/framework/target");
 
   let url = document.getElementById("testContent").href;
   attachURL(url, onTab);
 
-  function onTab(_, client, form, contentDoc) {
+  async function onTab(_, client, form, contentDoc) {
     let contentWin = contentDoc.defaultView;
     let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
     let selectedTab = chromeWin.gBrowser.selectedTab;
 
     let target = TargetFactory.forTab(selectedTab);
+    await target.makeRemote();
     let front = FramerateFront(client, form);
 
     front.startRecording().then(() => {
       window.setTimeout(() => {
         front.getPendingTicks().then(firstBatch => {
           /* eslint-disable max-nested-callbacks */
           target.once("will-navigate", () => {
             window.setTimeout(() => {