Commit 687bee3c authored by Nicolas Ouellet-Payeur's avatar Nicolas Ouellet-Payeur Committed by Commit Bot

Fix an Omnibox test on non-US keyboard layouts

Bug: 881859
Change-Id: Ic6d6945726d1dfd4fda5b59031c785d321730a09
Reviewed-on: https://chromium-review.googlesource.com/1214243Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589967}
parent b7cdf7b6
...@@ -1027,9 +1027,13 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, SearchDisabledDontCrashOnQuestionMark) { ...@@ -1027,9 +1027,13 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, SearchDisabledDontCrashOnQuestionMark) {
OmniboxView* omnibox_view = NULL; OmniboxView* omnibox_view = NULL;
ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view)); ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
base::string16 search_keyword(ASCIIToUTF16(kSearchKeyword)); // '?' isn't in the same place on all keyboard layouts, so send the character
// instead of keystrokes.
ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_OEM_2, ui::EF_SHIFT_DOWN)); ASSERT_NO_FATAL_FAILURE({
omnibox_view->OnBeforePossibleChange();
omnibox_view->SetUserText(base::UTF8ToUTF16("?"));
omnibox_view->OnAfterPossibleChange(true);
});
ASSERT_FALSE(omnibox_view->model()->is_keyword_hint()); ASSERT_FALSE(omnibox_view->model()->is_keyword_hint());
ASSERT_FALSE(omnibox_view->model()->is_keyword_selected()); ASSERT_FALSE(omnibox_view->model()->is_keyword_selected());
ASSERT_EQ(ASCIIToUTF16("?"), omnibox_view->GetText()); ASSERT_EQ(ASCIIToUTF16("?"), omnibox_view->GetText());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment