示例#1
0
/**
 * Setup the loader to return the provided mock object instead of the regular
 * runtime-client-factory module.
 *
 * @param {Object}
 *        mock should implement the following methods:
 *        - createClientForRuntime(runtime)
 */
function enableRuntimeClientFactoryMock(mock) {
  const { setMockedModule } = require("devtools/client/shared/browser-loader-mocks");
  setMockedModule(mock,
    "devtools/client/aboutdebugging-new/src/modules/runtime-client-factory");
}
/**
 * Setup the loader to return the provided mock object instead of the regular
 * usb-runtimes module.
 *
 * @param {Object}
 *        mock should implement the following methods:
 *        - addUSBRuntimesObserver(listener)
 *        - disableUSBRuntimes()
 *        - enableUSBRuntimes()
 *        - getUSBRuntimes()
 *        - removeUSBRuntimesObserver(listener)
 */
function enableUsbRuntimesMock(mock) {
  const { setMockedModule } = require("devtools/client/shared/browser-loader-mocks");
  setMockedModule(mock,
    "devtools/client/aboutdebugging-new/src/modules/usb-runtimes");
}