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

Unified Diff: chrome/browser/bookmarks/bookmark_utils_unittest.cc

Issue 3197009: Remove wstrings in bookmarks, part 10. (Closed)
Patch Set: Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | chrome/browser/extensions/extension_bookmarks_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_utils_unittest.cc
diff --git a/chrome/browser/bookmarks/bookmark_utils_unittest.cc b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
index 5fec3e529318a08ce1b23263902034824796c19b..ce9f7e6ffb8cf233eb22bf950d00e978df3f4933 100644
--- a/chrome/browser/bookmarks/bookmark_utils_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -27,27 +27,27 @@ TEST_F(BookmarkUtilsTest, GetBookmarksContainingText) {
std::vector<const BookmarkNode*> nodes;
bookmark_utils::GetBookmarksContainingText(
- &model, L"foo", 100, std::wstring(), &nodes);
+ &model, ASCIIToUTF16("foo"), 100, std::wstring(), &nodes);
ASSERT_EQ(1U, nodes.size());
EXPECT_TRUE(nodes[0] == n1);
EXPECT_TRUE(bookmark_utils::DoesBookmarkContainText(
- n1, L"foo", std::wstring()));
+ n1, ASCIIToUTF16("foo"), std::wstring()));
nodes.clear();
bookmark_utils::GetBookmarksContainingText(
- &model, L"cnn", 100, std::wstring(), &nodes);
+ &model, ASCIIToUTF16("cnn"), 100, std::wstring(), &nodes);
ASSERT_EQ(1U, nodes.size());
EXPECT_TRUE(nodes[0] == n2);
EXPECT_TRUE(bookmark_utils::DoesBookmarkContainText(
- n2, L"cnn", std::wstring()));
+ n2, ASCIIToUTF16("cnn"), std::wstring()));
nodes.clear();
bookmark_utils::GetBookmarksContainingText(
- &model, L"foo bar", 100, std::wstring(), &nodes);
+ &model, ASCIIToUTF16("foo bar"), 100, std::wstring(), &nodes);
ASSERT_EQ(1U, nodes.size());
EXPECT_TRUE(nodes[0] == n1);
EXPECT_TRUE(bookmark_utils::DoesBookmarkContainText(
- n1, L"foo bar", std::wstring()));
+ n1, ASCIIToUTF16("foo bar"), std::wstring()));
nodes.clear();
}
@@ -58,16 +58,16 @@ TEST_F(BookmarkUtilsTest, DoesBookmarkContainText) {
GURL("http://www.google.com"));
// Matches to the title.
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"ar", std::wstring()));
+ node, ASCIIToUTF16("ar"), std::wstring()));
// Matches to the URL
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"www", std::wstring()));
+ node, ASCIIToUTF16("www"), std::wstring()));
// No match.
ASSERT_FALSE(bookmark_utils::DoesBookmarkContainText(
- node, L"cnn", std::wstring()));
+ node, ASCIIToUTF16("cnn"), std::wstring()));
// Tests for a Japanese IDN.
- const wchar_t* kDecodedIdn = L"\x30B0\x30FC\x30B0\x30EB";
+ const string16 kDecodedIdn = WideToUTF16(L"\x30B0\x30FC\x30B0\x30EB");
node = model.AddURL(model.other_node(), 0, ASCIIToUTF16("foo bar"),
GURL("http://xn--qcka1pmc.jp"));
// Unicode query doesn't match if languages have no "ja".
@@ -78,23 +78,23 @@ TEST_F(BookmarkUtilsTest, DoesBookmarkContainText) {
node, kDecodedIdn, L"ja"));
// Punycode query also matches as ever.
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"qcka1pmc", L"ja"));
+ node, ASCIIToUTF16("qcka1pmc"), L"ja"));
// Tests with various lower/upper case characters.
node = model.AddURL(model.other_node(), 0, ASCIIToUTF16("FOO bar"),
GURL("http://www.google.com/search?q=ABC"));
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"foo", std::wstring()));
+ node, ASCIIToUTF16("foo"), std::wstring()));
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"Foo", std::wstring()));
+ node, ASCIIToUTF16("Foo"), std::wstring()));
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"FOO", std::wstring()));
+ node, ASCIIToUTF16("FOO"), std::wstring()));
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"google abc", std::wstring()));
+ node, ASCIIToUTF16("google abc"), std::wstring()));
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"google ABC", std::wstring()));
+ node, ASCIIToUTF16("google ABC"), std::wstring()));
ASSERT_TRUE(bookmark_utils::DoesBookmarkContainText(
- node, L"http://www.google.com/search?q=A", std::wstring()));
+ node, ASCIIToUTF16("http://www.google.com/search?q=A"), std::wstring()));
}
#if !defined(OS_MACOSX)
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | chrome/browser/extensions/extension_bookmarks_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698