diff options
author | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-17 19:25:06 +0000 |
---|---|---|
committer | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-17 19:25:06 +0000 |
commit | 12bd0587232f99ec1ec416002e57e12c6b2bcd06 (patch) | |
tree | 4522dbab490b7cbdba1301fd0e3457e4d79899f0 /chrome/browser/search_engines | |
parent | 21c41e9e4fa1792e8a1d41104035b71925647dd8 (diff) | |
download | chromium_src-12bd0587232f99ec1ec416002e57e12c6b2bcd06.zip chromium_src-12bd0587232f99ec1ec416002e57e12c6b2bcd06.tar.gz chromium_src-12bd0587232f99ec1ec416002e57e12c6b2bcd06.tar.bz2 |
This test only passed if RLZTracker::InitRlz hadn't been called,
so it failed when the test run order happened to change.
This change fixes that.
Review URL: http://codereview.chromium.org/42283
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r-- | chrome/browser/search_engines/template_url_unittest.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/search_engines/template_url_unittest.cc b/chrome/browser/search_engines/template_url_unittest.cc index 26f9367..7a44b6c 100644 --- a/chrome/browser/search_engines/template_url_unittest.cc +++ b/chrome/browser/search_engines/template_url_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/base_paths.h" #include "base/string_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/rlz/rlz.h" @@ -303,18 +304,25 @@ TEST_F(TemplateURLTest, Suggestions) { } TEST_F(TemplateURLTest, RLZ) { +#if defined(OS_WIN) + RLZTracker::InitRlz(base::DIR_EXE); +#endif std::wstring rlz_string; RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz_string); TemplateURL t_url; - TemplateURLRef ref(L"http://bar/{google:RLZ}{searchTerms}", 1, 2); + TemplateURLRef ref(L"http://bar/?{google:RLZ}{searchTerms}", 1, 2); ASSERT_TRUE(ref.IsValid()); ASSERT_TRUE(ref.SupportsReplacement()); GURL result = ref.ReplaceSearchTerms(t_url, L"x", TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); ASSERT_TRUE(result.is_valid()); - // TODO(levin): fix this! - // ASSERT_EQ("http://bar/" + WideToUTF8(rlz_string) + "x", result.spec()); + std::string expected_url = "http://bar/?"; + if (!rlz_string.empty()) { + expected_url += "rlz=" + WideToUTF8(rlz_string) + "&"; + } + expected_url += "x"; + ASSERT_EQ(expected_url, result.spec()); } TEST_F(TemplateURLTest, HostAndSearchTermKey) { |