function testRemovalFlow(indexToRemove) {
    /**
     * Test whether or not clicking remove-button sends the correct
     * parameters to the browserProxy.removeUsbDevice() function.
     */
    const menuButton = testElement.root.querySelectorAll(
        'paper-icon-button-light.icon-more-vert')[indexToRemove];
    const removeButton = testElement.$.removeButton;
    MockInteractions.tap(menuButton.querySelector('button'));
    MockInteractions.tap(removeButton);
    return browserProxy.whenCalled('removeUsbDevice').then(function(args) {
      /**
       * removeUsbDevice() is expected to be called with arguments as
       * [origin, embeddingOrigin, object].
       */
      assertEquals(deviceList[indexToRemove].origin, args[0]);
      assertEquals(deviceList[indexToRemove].embeddingOrigin, args[1]);
      assertEquals(deviceList[indexToRemove].object, args[2]);

      const dialog = testElement.$$('cr-action-menu');
      assertFalse(dialog.open);
    });
  }
/**
   * A reusable function to test removing different devices.
   * @param {!number} indexToRemove index of devices to be removed.
   * @return {!Promise}
   */
A reusable function to test removing different devices.
@param {!number} indexToRemove index of devices to be removed.
@return {!Promise}
A reusable function to test removing different devices . @param { !number } indexToRemove index of devices to be removed . @return { !Promise }
function testRemovalFlow(indexToRemove) {
    const menuButton = testElement.root.querySelectorAll(
        'paper-icon-button-light.icon-more-vert')[indexToRemove];
    const removeButton = testElement.$.removeButton;
    MockInteractions.tap(menuButton.querySelector('button'));
    MockInteractions.tap(removeButton);
    return browserProxy.whenCalled('removeUsbDevice').then(function(args) {
      assertEquals(deviceList[indexToRemove].origin, args[0]);
      assertEquals(deviceList[indexToRemove].embeddingOrigin, args[1]);
      assertEquals(deviceList[indexToRemove].object, args[2]);
      const dialog = testElement.$$('cr-action-menu');
      assertFalse(dialog.open);
    });
  }
function testRemovalFlow ( indexToRemove ) { const menuButton = testElement . root . querySelectorAll ( 'paper-icon-button-light.icon-more-vert' ) [ indexToRemove ] ; const removeButton = testElement . $ . removeButton ; MockInteractions . tap ( menuButton . querySelector ( 'button' ) ) ; MockInteractions . tap ( removeButton ) ; return browserProxy . whenCalled ( 'removeUsbDevice' ) . then ( function ( args ) { assertEquals ( deviceList [ indexToRemove ] . origin , args [ 0 ] ) ; assertEquals ( deviceList [ indexToRemove ] . embeddingOrigin , args [ 1 ] ) ; assertEquals ( deviceList [ indexToRemove ] . object , args [ 2 ] ) ; const dialog = testElement . $$ ( 'cr-action-menu' ) ; assertFalse ( dialog . open ) ; } ) ; }
A reusable function to test removing different devices.
A reusable function to test removing different devices .
/**
     * Test whether or not clicking remove-button sends the correct
     * parameters to the browserProxy.removeUsbDevice() function.
     */ /**
       * removeUsbDevice() is expected to be called with arguments as
       * [origin, embeddingOrigin, object].
       */