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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view_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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 772
773 // Revert to keyword hint mode. 773 // Revert to keyword hint mode.
774 omnibox_view->model()->ClearKeyword(string16()); 774 omnibox_view->model()->ClearKeyword(string16());
775 ASSERT_TRUE(omnibox_view->model()->is_keyword_hint()); 775 ASSERT_TRUE(omnibox_view->model()->is_keyword_hint());
776 ASSERT_EQ(search_keyword, omnibox_view->model()->keyword()); 776 ASSERT_EQ(search_keyword, omnibox_view->model()->keyword());
777 ASSERT_EQ(search_keyword, omnibox_view->GetText()); 777 ASSERT_EQ(search_keyword, omnibox_view->GetText());
778 778
779 // Keyword should also be accepted by typing an ideographic space. 779 // Keyword should also be accepted by typing an ideographic space.
780 omnibox_view->OnBeforePossibleChange(); 780 omnibox_view->OnBeforePossibleChange();
781 omnibox_view->SetWindowTextAndCaretPos(search_keyword + 781 omnibox_view->SetWindowTextAndCaretPos(search_keyword +
782 WideToUTF16(L"\x3000"), search_keyword.length() + 1, false, false); 782 base::WideToUTF16(L"\x3000"), search_keyword.length() + 1, false,
783 false);
783 omnibox_view->OnAfterPossibleChange(); 784 omnibox_view->OnAfterPossibleChange();
784 ASSERT_FALSE(omnibox_view->model()->is_keyword_hint()); 785 ASSERT_FALSE(omnibox_view->model()->is_keyword_hint());
785 ASSERT_EQ(search_keyword, omnibox_view->model()->keyword()); 786 ASSERT_EQ(search_keyword, omnibox_view->model()->keyword());
786 ASSERT_TRUE(omnibox_view->GetText().empty()); 787 ASSERT_TRUE(omnibox_view->GetText().empty());
787 788
788 // Revert to keyword hint mode. 789 // Revert to keyword hint mode.
789 omnibox_view->model()->ClearKeyword(string16()); 790 omnibox_view->model()->ClearKeyword(string16());
790 ASSERT_TRUE(omnibox_view->model()->is_keyword_hint()); 791 ASSERT_TRUE(omnibox_view->model()->is_keyword_hint());
791 ASSERT_EQ(search_keyword, omnibox_view->model()->keyword()); 792 ASSERT_EQ(search_keyword, omnibox_view->model()->keyword());
792 ASSERT_EQ(search_keyword, omnibox_view->GetText()); 793 ASSERT_EQ(search_keyword, omnibox_view->GetText());
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 1729
1729 // These platforms should read bookmark format. 1730 // These platforms should read bookmark format.
1730 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MACOSX) 1731 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MACOSX)
1731 string16 title; 1732 string16 title;
1732 std::string url; 1733 std::string url;
1733 clipboard->ReadBookmark(&title, &url); 1734 clipboard->ReadBookmark(&title, &url);
1734 EXPECT_EQ(target_url, url); 1735 EXPECT_EQ(target_url, url);
1735 EXPECT_EQ(ASCIIToUTF16(target_url), title); 1736 EXPECT_EQ(ASCIIToUTF16(target_url), title);
1736 #endif 1737 #endif
1737 } 1738 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/find_bar/find_bar_host_browsertest.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698