Skip to content

Commit

Permalink
Omnibox: Enable Steady State Elisions in tests by default.
Browse files Browse the repository at this point in the history
Bug: 842236
Change-Id: Iba7afb45322ea3e446203274b2fe87bd6c80e9f9
Reviewed-on: https://chromium-review.googlesource.com/1178621
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584493}
  • Loading branch information
Tommy C. Li authored and Commit Bot committed Aug 20, 2018
1 parent 7dceb58 commit a286b1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,9 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FragmentUnescapedForDisplay) {
OmniboxView* view = nullptr;
ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view));
ui_test_utils::NavigateToURL(browser(),
GURL("https://www.google.com/#%E2%98%83"));
GURL("http://example.com/#%E2%98%83"));

EXPECT_EQ(view->GetText(),
base::UTF8ToUTF16("https://www.google.com/#\u2603"));
EXPECT_EQ(view->GetText(), base::UTF8ToUTF16("example.com/#\u2603"));
}

// Ensure that when the user navigates between suggestions, that the accessible
Expand All @@ -537,6 +536,9 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FriendlyAccessibleLabel) {
match.description = base::ASCIIToUTF16("Google");
match.allowed_to_be_default_match = true;

// Enter user input mode to prevent spurious unelision.
omnibox_view->model()->SetInputInProgress(true);

// Populate suggestions for the omnibox popup.
AutocompleteController* autocomplete_controller =
omnibox_view->model()->popup_model()->autocomplete_controller();
Expand All @@ -561,6 +563,8 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FriendlyAccessibleLabel) {
omnibox_view_views->OnTemporaryTextMaybeChanged(match_url, match, false,
false);
omnibox_view->SelectAll(true);
EXPECT_EQ(base::ASCIIToUTF16("https://google.com"),
omnibox_view_views->GetText());

// Test friendly label.
const int kFriendlyPrefixLength = match.description.size() + 1;
Expand Down Expand Up @@ -589,6 +593,9 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FriendlyAccessibleLabel) {
set_selection_action_data.anchor_offset = kFriendlyPrefixLength + 3;
omnibox_view_views->HandleAccessibleAction(set_selection_action_data);

EXPECT_EQ(base::ASCIIToUTF16("https://google.com"),
omnibox_view_views->GetText());

// Type "x" to replace the selected "tt" with that character.
ASSERT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_X, false,
false, false, false));
Expand Down
1 change: 1 addition & 0 deletions testing/variations/fieldtrial_testing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2878,6 +2878,7 @@
"OmniboxRichEntitySuggestions",
"OmniboxTabSwitchSuggestions",
"OmniboxTailSuggestions",
"OmniboxUIExperimentHideSteadyStateUrlSchemeAndSubdomains",
"OmniboxUIExperimentShowSuggestionFavicons",
"OmniboxUIExperimentSwapTitleAndUrl",
"OmniboxUIExperimentVerticalMargin",
Expand Down

0 comments on commit a286b1b

Please sign in to comment.