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

Side by Side Diff: chrome/browser/search_engines/template_url_unittest.cc

Issue 126223: Replace std:;wstring with std::string in locale-name related APIs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/rlz/rlz.h" 8 #include "chrome/browser/rlz/rlz.h"
9 #include "chrome/browser/search_engines/template_url.h" 9 #include "chrome/browser/search_engines/template_url.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 "http://foo/UTF-8a{language}aXa" }, 231 "http://foo/UTF-8a{language}aXa" },
232 }; 232 };
233 TemplateURL turl; 233 TemplateURL turl;
234 turl.add_input_encoding("UTF-8"); 234 turl.add_input_encoding("UTF-8");
235 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { 235 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) {
236 TemplateURLRef ref(data[i].url, 1, 2); 236 TemplateURLRef ref(data[i].url, 1, 2);
237 EXPECT_TRUE(ref.IsValid()); 237 EXPECT_TRUE(ref.IsValid());
238 EXPECT_TRUE(ref.SupportsReplacement()); 238 EXPECT_TRUE(ref.SupportsReplacement());
239 std::string expected_result = data[i].expected_result; 239 std::string expected_result = data[i].expected_result;
240 ReplaceSubstringsAfterOffset(&expected_result, 0, "{language}", 240 ReplaceSubstringsAfterOffset(&expected_result, 0, "{language}",
241 WideToASCII(g_browser_process->GetApplicationLocale())); 241 g_browser_process->GetApplicationLocale());
242 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(turl, L"X", 242 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(turl, L"X",
243 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); 243 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring())));
244 EXPECT_TRUE(result.is_valid()); 244 EXPECT_TRUE(result.is_valid());
245 EXPECT_EQ(expected_result, result.spec()); 245 EXPECT_EQ(expected_result, result.spec());
246 } 246 }
247 } 247 }
248 248
249 249
250 // Tests replacing search terms in various encodings and making sure the 250 // Tests replacing search terms in various encodings and making sure the
251 // generated URL matches the expected value. 251 // generated URL matches the expected value.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 EXPECT_FALSE(t_url.autogenerate_keyword()); 386 EXPECT_FALSE(t_url.autogenerate_keyword());
387 t_url.set_keyword(L"foo"); 387 t_url.set_keyword(L"foo");
388 EXPECT_EQ(L"foo", t_url.keyword()); 388 EXPECT_EQ(L"foo", t_url.keyword());
389 t_url.set_autogenerate_keyword(true); 389 t_url.set_autogenerate_keyword(true);
390 EXPECT_TRUE(t_url.autogenerate_keyword()); 390 EXPECT_TRUE(t_url.autogenerate_keyword());
391 EXPECT_EQ(L"google.com", t_url.keyword()); 391 EXPECT_EQ(L"google.com", t_url.keyword());
392 t_url.set_keyword(L"foo"); 392 t_url.set_keyword(L"foo");
393 EXPECT_FALSE(t_url.autogenerate_keyword()); 393 EXPECT_FALSE(t_url.autogenerate_keyword());
394 EXPECT_EQ(L"foo", t_url.keyword()); 394 EXPECT_EQ(L"foo", t_url.keyword());
395 } 395 }
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url.cc ('k') | chrome/browser/tab_contents/render_view_context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698