testAutogenerationOff() {
    mockCtrl.$replayAll();

    setUpAnchor('', '', true);
    createAndShow();

    // Disable the autogen feature
    dialog.setAutogenFeatureEnabled(false);

    // Simulate typing a url when everything is empty, should not autogen.
    setUrlInputText(ANCHOR_URL);
    assertEquals(
        'Display text should not have been autogenerated', '',
        getDisplayInputText());

    // Simulate typing text when url is set, afterwards should not autogen.
    setDisplayInputText(ANCHOR_TEXT);
    setUrlInputText(ANCHOR_MAILTO);
    assertNotEquals(
        'Display text should not have been autogenerated', ANCHOR_MAILTO,
        getDisplayInputText());
    assertEquals(
        'Display text should have remained the same', ANCHOR_TEXT,
        getDisplayInputText());

    // Simulate typing text equal to existing url, afterwards should not
    // autogen.
    setDisplayInputText(ANCHOR_MAILTO);
    setUrlInputText(ANCHOR_URL);
    assertEquals(
        'Display text should not have been autogenerated', ANCHOR_MAILTO,
        getDisplayInputText());

    mockCtrl.$verifyAll();
  }
Tests that the display text is not autogenerated from the url input in all
situations when the autogeneration feature is turned off.