Bug 1495383 - Test USB runtime in worker remote runtime mochitest;r=daisuke,Ola
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 14 Jan 2019 12:50:45 +0000
changeset 514232 e93d25864ea7e494a7fd1a18f0b4c2811f232055
parent 514231 26303cb81de738dd341f54a00955d76a332c6654
child 514233 1e52ffae5eb49e06edc3ec9701e3365ef7649c78
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke, Ola
bugs1495383
milestone66.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 1495383 - Test USB runtime in worker remote runtime mochitest;r=daisuke,Ola Depends on D15083 Differential Revision: https://phabricator.services.mozilla.com/D15084
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_workers_remote_runtime.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_workers_remote_runtime.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_workers_remote_runtime.js
@@ -3,16 +3,19 @@
 
 "use strict";
 
 /* import-globals-from helper-mocks.js */
 Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
 
 const NETWORK_RUNTIME_HOST = "localhost:6080";
 const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
+const USB_RUNTIME_ID = "test-runtime-id";
+const USB_RUNTIME_DEVICE_NAME = "test device name";
+const USB_RUNTIME_APP_NAME = "TestUsbApp";
 
 const TESTS = [
   {
     category: "Other Workers",
     propertyName: "otherWorkers",
     workerName: "other/worker/script.js",
   }, {
     category: "Service Workers",
@@ -32,16 +35,31 @@ const EMPTY_WORKERS_RESPONSE = {
 };
 
 // Test that workers are displayed and updated for remote runtimes when expected.
 add_task(async function() {
   const mocks = new Mocks();
 
   const { document, tab } = await openAboutDebugging();
 
+  info("Prepare USB client mock");
+  const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, {
+    deviceName: USB_RUNTIME_DEVICE_NAME,
+    name: USB_RUNTIME_APP_NAME,
+  });
+  mocks.emitUSBUpdate();
+
+  info("Test addons in runtime page for USB client");
+  await connectToRuntime(USB_RUNTIME_DEVICE_NAME, document);
+  await selectRuntime(USB_RUNTIME_DEVICE_NAME, USB_RUNTIME_APP_NAME, document);
+  for (const testData of TESTS) {
+    await testWorkerOnMockedRemoteClient(testData, usbClient, mocks.thisFirefoxClient,
+     document);
+  }
+
   info("Prepare Network client mock");
   const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
     name: NETWORK_RUNTIME_APP_NAME,
   });
 
   info("Test workers in runtime page for Network client");
   await connectToRuntime(NETWORK_RUNTIME_HOST, document);
   await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document);