summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/search_engines/template_url_unittest.cc14
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) {