/**
   * Verifies that the referrer is not set for "Open in new incognito tab". Bug:
   * crbug.com/413216 @MediumTest @Feature({"Browser"})
   */
  @FlakyTest
  public void testOpenInIncognitoTabNoReferrer() throws InterruptedException, TimeoutException {
    String url = TestHttpServerClient.getUrl("chrome/test/data/android/context_menu_test.html");
    triggerContextMenuLoad(url, "testLink", R.id.contextmenu_open_in_incognito_tab);

    assertNotNull(mOpenNewTabLoadUrlParams);
    assertNull(mOpenNewTabLoadUrlParams.getReferrer());
  }
  /**
   * Verifies that the referrer is stripped from username and password fields. Bug:
   * crbug.com/413216 @MediumTest @Feature({"Browser"})
   */
  @FlakyTest
  public void testOpenInNewTabSanitizeReferrer() throws InterruptedException, TimeoutException {
    String url =
        TestHttpServerClient.getUrl(
            "chrome/test/data/android/context_menu_test.html", "user", "pass");
    String expectedReferrer =
        TestHttpServerClient.getUrl("chrome/test/data/android/context_menu_test.html");
    assertTrue(url.contains("pass")); // Sanity check.
    triggerContextMenuLoad(url, "testLink", R.id.contextmenu_open_in_new_tab);

    assertNotNull(mOpenNewTabLoadUrlParams);
    assertEquals(expectedReferrer, mOpenNewTabLoadUrlParams.getReferrer().getUrl());
  }