| Index: chrome/browser/instant/instant_browsertest.cc
|
| diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
|
| index 849904dfd9417f565156707deea51e965b0a955b..94478ea9595900a3b75ae66c46b14b939b625eaa 100644
|
| --- a/chrome/browser/instant/instant_browsertest.cc
|
| +++ b/chrome/browser/instant/instant_browsertest.cc
|
| @@ -79,7 +79,7 @@ class InstantTest : public InProcessBrowserTest {
|
|
|
| void SetOmniboxText(const std::string& text) {
|
| FocusOmnibox();
|
| - omnibox()->SetUserText(ASCIIToUTF16(text));
|
| + omnibox()->SetUserText(UTF8ToUTF16(text));
|
| }
|
|
|
| void SetOmniboxTextAndWaitForInstantToShow(const std::string& text) {
|
| @@ -129,7 +129,7 @@ class InstantTest : public InProcessBrowserTest {
|
| bool ExecuteScript(const std::string& script) WARN_UNUSED_RESULT {
|
| return content::ExecuteJavaScript(
|
| instant()->GetPreviewContents()->web_contents()->GetRenderViewHost(),
|
| - std::wstring(), ASCIIToWide(script));
|
| + std::wstring(), UTF8ToWide(script));
|
| }
|
|
|
| bool CheckVisibilityIs(TabContents* tab, bool expected) WARN_UNUSED_RESULT {
|
| @@ -867,3 +867,49 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantLoaderRefresh) {
|
| instant()->OnAutocompleteLostFocus(NULL);
|
| EXPECT_FALSE(instant()->loader()->supports_instant());
|
| }
|
| +
|
| +// Test that suggestions are case insensitive. http://crbug.com/150728
|
| +IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreCaseInsensitive) {
|
| + ASSERT_NO_FATAL_FAILURE(SetupInstant("instant.html"));
|
| + FocusOmniboxAndWaitForInstantSupport();
|
| +
|
| + EXPECT_TRUE(ExecuteScript("suggestion = [ { value: 'INSTANT' } ]"));
|
| +
|
| + SetOmniboxTextAndWaitForInstantToShow("in");
|
| + EXPECT_EQ(ASCIIToUTF16("instant"), omnibox()->GetText());
|
| +
|
| + instant()->Hide();
|
| + SetOmniboxTextAndWaitForInstantToShow("IN");
|
| + EXPECT_EQ(ASCIIToUTF16("INSTANT"), omnibox()->GetText());
|
| +
|
| + // U+0130 == LATIN CAPITAL LETTER I WITH DOT ABOVE
|
| + EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u0130NSTANT' } ]"));
|
| +
|
| + instant()->Hide();
|
| + SetOmniboxTextAndWaitForInstantToShow("i");
|
| + EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText());
|
| +
|
| + instant()->Hide();
|
| + SetOmniboxTextAndWaitForInstantToShow("I");
|
| + EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText());
|
| +
|
| + instant()->Hide();
|
| + SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"i\u0307"));
|
| + EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText());
|
| +
|
| + instant()->Hide();
|
| + SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"I\u0307"));
|
| + EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText());
|
| +
|
| + instant()->Hide();
|
| + SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"\u0130"));
|
| + EXPECT_EQ(WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText());
|
| +
|
| + instant()->Hide();
|
| + SetOmniboxTextAndWaitForInstantToShow("in");
|
| + EXPECT_EQ(ASCIIToUTF16("in"), omnibox()->GetText());
|
| +
|
| + instant()->Hide();
|
| + SetOmniboxTextAndWaitForInstantToShow("IN");
|
| + EXPECT_EQ(ASCIIToUTF16("IN"), omnibox()->GetText());
|
| +}
|
|
|