| Index: chrome/browser/search_engines/template_url_unittest.cc
|
| diff --git a/chrome/browser/search_engines/template_url_unittest.cc b/chrome/browser/search_engines/template_url_unittest.cc
|
| index 68b907b1cb7842e1971b6649d8bd0e5699215b54..c8a4085ef104c494dea849ee069194ff147a5818 100644
|
| --- a/chrome/browser/search_engines/template_url_unittest.cc
|
| +++ b/chrome/browser/search_engines/template_url_unittest.cc
|
| @@ -681,6 +681,34 @@ TEST_F(TemplateURLTest, RLZ) {
|
| EXPECT_EQ(expected_url, result.spec());
|
| }
|
|
|
| +#if !defined(OS_ANDROID) && !defined(OS_IOS)
|
| +TEST_F(TemplateURLTest, RLZFromAppList) {
|
| + base::string16 rlz_string;
|
| +#if defined(ENABLE_RLZ)
|
| + std::string brand;
|
| + if (google_util::GetBrand(&brand) && !brand.empty() &&
|
| + !google_util::IsOrganic(brand)) {
|
| + RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_APP_LIST, &rlz_string);
|
| + }
|
| +#endif
|
| +
|
| + TemplateURLData data;
|
| + data.SetURL("http://bar/?{google:RLZ}{searchTerms}");
|
| + TemplateURL url(NULL, data);
|
| + EXPECT_TRUE(url.url_ref().IsValid());
|
| + ASSERT_TRUE(url.url_ref().SupportsReplacement());
|
| + TemplateURLRef::SearchTermsArgs args(ASCIIToUTF16("x"));
|
| + args.from_app_list = true;
|
| + GURL result(url.url_ref().ReplaceSearchTerms(args));
|
| + ASSERT_TRUE(result.is_valid());
|
| + std::string expected_url = "http://bar/?";
|
| + if (!rlz_string.empty())
|
| + expected_url += "rlz=" + base::UTF16ToUTF8(rlz_string) + "&";
|
| + expected_url += "x";
|
| + EXPECT_EQ(expected_url, result.spec());
|
| +}
|
| +#endif
|
| +
|
| TEST_F(TemplateURLTest, HostAndSearchTermKey) {
|
| struct TestData {
|
| const std::string url;
|
|
|