Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: chrome/browser/instant/instant_browsertest.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/importer/importer_unittest_utils.cc ('k') | chrome/browser/jumplist_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/content_settings/host_content_settings_map.h" 5 #include "chrome/browser/content_settings/host_content_settings_map.h"
6 #include "chrome/browser/history/history_service_factory.h" 6 #include "chrome/browser/history/history_service_factory.h"
7 #include "chrome/browser/instant/instant_overlay.h" 7 #include "chrome/browser/instant/instant_overlay.h"
8 #include "chrome/browser/instant/instant_service.h" 8 #include "chrome/browser/instant/instant_service.h"
9 #include "chrome/browser/instant/instant_service_factory.h" 9 #include "chrome/browser/instant/instant_service_factory.h"
10 #include "chrome/browser/instant/instant_test_utils.h" 10 #include "chrome/browser/instant/instant_test_utils.h"
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 805
806 omnibox()->RevertAll(); 806 omnibox()->RevertAll();
807 SetOmniboxTextAndWaitForInstantToShow("IN"); 807 SetOmniboxTextAndWaitForInstantToShow("IN");
808 EXPECT_EQ(ASCIIToUTF16("INSTANT"), omnibox()->GetText()); 808 EXPECT_EQ(ASCIIToUTF16("INSTANT"), omnibox()->GetText());
809 809
810 // U+0130 == LATIN CAPITAL LETTER I WITH DOT ABOVE 810 // U+0130 == LATIN CAPITAL LETTER I WITH DOT ABOVE
811 EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u0130NSTANT' } ]")); 811 EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u0130NSTANT' } ]"));
812 812
813 omnibox()->RevertAll(); 813 omnibox()->RevertAll();
814 SetOmniboxTextAndWaitForInstantToShow("i"); 814 SetOmniboxTextAndWaitForInstantToShow("i");
815 EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText()); 815 EXPECT_EQ(base::WideToUTF16(L"i\u0307nstant"), omnibox()->GetText());
816 816
817 omnibox()->RevertAll(); 817 omnibox()->RevertAll();
818 SetOmniboxTextAndWaitForInstantToShow("I"); 818 SetOmniboxTextAndWaitForInstantToShow("I");
819 EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText()); 819 EXPECT_EQ(base::WideToUTF16(L"I\u0307nstant"), omnibox()->GetText());
820 820
821 omnibox()->RevertAll(); 821 omnibox()->RevertAll();
822 SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"i\u0307")); 822 SetOmniboxTextAndWaitForInstantToShow(base::WideToUTF8(L"i\u0307"));
823 EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText()); 823 EXPECT_EQ(base::WideToUTF16(L"i\u0307nstant"), omnibox()->GetText());
824 824
825 omnibox()->RevertAll(); 825 omnibox()->RevertAll();
826 SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"I\u0307")); 826 SetOmniboxTextAndWaitForInstantToShow(base::WideToUTF8(L"I\u0307"));
827 EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText()); 827 EXPECT_EQ(base::WideToUTF16(L"I\u0307nstant"), omnibox()->GetText());
828 828
829 omnibox()->RevertAll(); 829 omnibox()->RevertAll();
830 SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"\u0130")); 830 SetOmniboxTextAndWaitForInstantToShow(base::WideToUTF8(L"\u0130"));
831 EXPECT_EQ(WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText()); 831 EXPECT_EQ(base::WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText());
832 832
833 omnibox()->RevertAll(); 833 omnibox()->RevertAll();
834 SetOmniboxTextAndWaitForInstantToShow("in"); 834 SetOmniboxTextAndWaitForInstantToShow("in");
835 EXPECT_EQ(ASCIIToUTF16("in"), omnibox()->GetText()); 835 EXPECT_EQ(ASCIIToUTF16("in"), omnibox()->GetText());
836 836
837 omnibox()->RevertAll(); 837 omnibox()->RevertAll();
838 SetOmniboxTextAndWaitForInstantToShow("IN"); 838 SetOmniboxTextAndWaitForInstantToShow("IN");
839 EXPECT_EQ(ASCIIToUTF16("IN"), omnibox()->GetText()); 839 EXPECT_EQ(ASCIIToUTF16("IN"), omnibox()->GetText());
840 840
841 // Check that a d with a dot above and below it is completed regardless of 841 // Check that a d with a dot above and below it is completed regardless of
842 // how that is encoded. 842 // how that is encoded.
843 // U+1E0D = LATIN SMALL LETTER D WITH DOT BELOW 843 // U+1E0D = LATIN SMALL LETTER D WITH DOT BELOW
844 // U+1E0B = LATIN SMALL LETTER D WITH DOT ABOVE 844 // U+1E0B = LATIN SMALL LETTER D WITH DOT ABOVE
845 EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u1e0d\\u0307oh' } ]")); 845 EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u1e0d\\u0307oh' } ]"));
846 846
847 omnibox()->RevertAll(); 847 omnibox()->RevertAll();
848 SetOmniboxTextAndWaitForInstantToShow(WideToUTF8(L"\u1e0b\u0323")); 848 SetOmniboxTextAndWaitForInstantToShow(base::WideToUTF8(L"\u1e0b\u0323"));
849 EXPECT_EQ(WideToUTF16(L"\u1e0b\u0323oh"), omnibox()->GetText()); 849 EXPECT_EQ(base::WideToUTF16(L"\u1e0b\u0323oh"), omnibox()->GetText());
850 } 850 }
851 851
852 // Flakes on Windows and Mac: http://crbug.com/170677 852 // Flakes on Windows and Mac: http://crbug.com/170677
853 #if defined(OS_WIN) || defined(OS_MACOSX) 853 #if defined(OS_WIN) || defined(OS_MACOSX)
854 #define MAYBE_CommitInNewTab DISABLED_CommitInNewTab 854 #define MAYBE_CommitInNewTab DISABLED_CommitInNewTab
855 #else 855 #else
856 #define MAYBE_CommitInNewTab CommitInNewTab 856 #define MAYBE_CommitInNewTab CommitInNewTab
857 #endif 857 #endif
858 // Test that the preview can be committed onto a new tab. 858 // Test that the preview can be committed onto a new tab.
859 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_CommitInNewTab) { 859 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_CommitInNewTab) {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 content::WebContents* active_tab = 1000 content::WebContents* active_tab =
1001 browser()->tab_strip_model()->GetActiveWebContents(); 1001 browser()->tab_strip_model()->GetActiveWebContents();
1002 EXPECT_TRUE(instant_service->IsInstantProcess( 1002 EXPECT_TRUE(instant_service->IsInstantProcess(
1003 active_tab->GetRenderProcessHost()->GetID())); 1003 active_tab->GetRenderProcessHost()->GetID()));
1004 1004
1005 // Navigating away should change the process. 1005 // Navigating away should change the process.
1006 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); 1006 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL));
1007 EXPECT_FALSE(instant_service->IsInstantProcess( 1007 EXPECT_FALSE(instant_service->IsInstantProcess(
1008 active_tab->GetRenderProcessHost()->GetID())); 1008 active_tab->GetRenderProcessHost()->GetID()));
1009 } 1009 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/importer_unittest_utils.cc ('k') | chrome/browser/jumplist_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698