Bug 1563621 - Fix browser_main_target.js product assertion when running in headless mode r=remote-protocol-reviewers,ato
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 05 Jul 2019 07:01:19 +0000
changeset 541120 2916482ae45442419bd5d7b8a29883fdad06731e
parent 541119 d8612428d805feed01c8bc8cff3981352889c1d2
child 541121 eb1f46404114367b499ec71dbc2f706e8f226bf8
push id11533
push userarchaeopteryx@coole-files.de
push dateMon, 08 Jul 2019 18:18:03 +0000
treeherdermozilla-beta@f4452e031aed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersremote-protocol-reviewers, ato
bugs1563621
milestone69.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 1563621 - Fix browser_main_target.js product assertion when running in headless mode r=remote-protocol-reviewers,ato Differential Revision: https://phabricator.services.mozilla.com/D37005
remote/test/browser/browser_main_target.js
--- a/remote/test/browser/browser_main_target.js
+++ b/remote/test/browser/browser_main_target.js
@@ -24,17 +24,20 @@ add_task(async function() {
   const client = await CDP({ target: targetURL });
   ok(true, "CDP client has been instantiated");
 
   const { Browser, Target } = client;
   ok(Browser, "The main process target exposes Browser domain");
   ok(Target, "The main process target exposes Target domain");
 
   const version = await Browser.getVersion();
-  is(version.product, "Firefox", "Browser.getVersion works");
+
+  const { isHeadless } = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
+  const expectedProduct = isHeadless ? "Headless Firefox" : "Firefox";
+  is(version.product, expectedProduct, "Browser.getVersion works");
 
   const { webSocketDebuggerUrl } = await CDP.Version();
   is(
     webSocketDebuggerUrl,
     targetURL,
     "Version endpoint refers to the same Main process target"
   );