| OLD | NEW |
| 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 25 matching lines...) Expand all Loading... |
| 36 TemplateURLRef ref(L"{searchTerms}", 0, 0); | 36 TemplateURLRef ref(L"{searchTerms}", 0, 0); |
| 37 ASSERT_TRUE(ref.IsValid()); | 37 ASSERT_TRUE(ref.IsValid()); |
| 38 } | 38 } |
| 39 | 39 |
| 40 TEST_F(TemplateURLTest, URLRefTestSearchTerms) { | 40 TEST_F(TemplateURLTest, URLRefTestSearchTerms) { |
| 41 TemplateURL t_url; | 41 TemplateURL t_url; |
| 42 TemplateURLRef ref(L"http://foo{searchTerms}", 0, 0); | 42 TemplateURLRef ref(L"http://foo{searchTerms}", 0, 0); |
| 43 ASSERT_TRUE(ref.IsValid()); | 43 ASSERT_TRUE(ref.IsValid()); |
| 44 | 44 |
| 45 ASSERT_TRUE(ref.SupportsReplacement()); | 45 ASSERT_TRUE(ref.SupportsReplacement()); |
| 46 GURL result = ref.ReplaceSearchTerms(t_url, L"search", | 46 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"search", |
| 47 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 47 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 48 ASSERT_TRUE(result.is_valid()); | 48 ASSERT_TRUE(result.is_valid()); |
| 49 ASSERT_EQ("http://foosearch/", result.spec()); | 49 ASSERT_EQ("http://foosearch/", result.spec()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 TEST_F(TemplateURLTest, URLRefTestCount) { | 52 TEST_F(TemplateURLTest, URLRefTestCount) { |
| 53 TemplateURL t_url; | 53 TemplateURL t_url; |
| 54 TemplateURLRef ref(L"http://foo{searchTerms}{count?}", 0, 0); | 54 TemplateURLRef ref(L"http://foo{searchTerms}{count?}", 0, 0); |
| 55 ASSERT_TRUE(ref.IsValid()); | 55 ASSERT_TRUE(ref.IsValid()); |
| 56 ASSERT_TRUE(ref.SupportsReplacement()); | 56 ASSERT_TRUE(ref.SupportsReplacement()); |
| 57 GURL result = ref.ReplaceSearchTerms(t_url, L"X", | 57 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"X", |
| 58 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 58 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 59 ASSERT_TRUE(result.is_valid()); | 59 ASSERT_TRUE(result.is_valid()); |
| 60 ASSERT_EQ("http://foox/", result.spec()); | 60 ASSERT_EQ("http://foox/", result.spec()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 TEST_F(TemplateURLTest, URLRefTestCount2) { | 63 TEST_F(TemplateURLTest, URLRefTestCount2) { |
| 64 TemplateURL t_url; | 64 TemplateURL t_url; |
| 65 TemplateURLRef ref(L"http://foo{searchTerms}{count}", 0, 0); | 65 TemplateURLRef ref(L"http://foo{searchTerms}{count}", 0, 0); |
| 66 ASSERT_TRUE(ref.IsValid()); | 66 ASSERT_TRUE(ref.IsValid()); |
| 67 ASSERT_TRUE(ref.SupportsReplacement()); | 67 ASSERT_TRUE(ref.SupportsReplacement()); |
| 68 GURL result = ref.ReplaceSearchTerms(t_url, L"X", | 68 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"X", |
| 69 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 69 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 70 ASSERT_TRUE(result.is_valid()); | 70 ASSERT_TRUE(result.is_valid()); |
| 71 ASSERT_EQ("http://foox10/", result.spec()); | 71 ASSERT_EQ("http://foox10/", result.spec()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 TEST_F(TemplateURLTest, URLRefTestIndices) { | 74 TEST_F(TemplateURLTest, URLRefTestIndices) { |
| 75 TemplateURL t_url; | 75 TemplateURL t_url; |
| 76 TemplateURLRef ref(L"http://foo{searchTerms}x{startIndex?}y{startPage?}", | 76 TemplateURLRef ref(L"http://foo{searchTerms}x{startIndex?}y{startPage?}", |
| 77 1, 2); | 77 1, 2); |
| 78 ASSERT_TRUE(ref.IsValid()); | 78 ASSERT_TRUE(ref.IsValid()); |
| 79 ASSERT_TRUE(ref.SupportsReplacement()); | 79 ASSERT_TRUE(ref.SupportsReplacement()); |
| 80 GURL result = ref.ReplaceSearchTerms(t_url, L"X", | 80 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"X", |
| 81 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 81 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 82 ASSERT_TRUE(result.is_valid()); | 82 ASSERT_TRUE(result.is_valid()); |
| 83 ASSERT_EQ("http://fooxxy/", result.spec()); | 83 ASSERT_EQ("http://fooxxy/", result.spec()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 TEST_F(TemplateURLTest, URLRefTestIndices2) { | 86 TEST_F(TemplateURLTest, URLRefTestIndices2) { |
| 87 TemplateURL t_url; | 87 TemplateURL t_url; |
| 88 TemplateURLRef ref(L"http://foo{searchTerms}x{startIndex}y{startPage}", 1, 2); | 88 TemplateURLRef ref(L"http://foo{searchTerms}x{startIndex}y{startPage}", 1, 2); |
| 89 ASSERT_TRUE(ref.IsValid()); | 89 ASSERT_TRUE(ref.IsValid()); |
| 90 ASSERT_TRUE(ref.SupportsReplacement()); | 90 ASSERT_TRUE(ref.SupportsReplacement()); |
| 91 GURL result = ref.ReplaceSearchTerms(t_url, L"X", | 91 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"X", |
| 92 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 92 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 93 ASSERT_TRUE(result.is_valid()); | 93 ASSERT_TRUE(result.is_valid()); |
| 94 ASSERT_EQ("http://fooxx1y2/", result.spec()); | 94 ASSERT_EQ("http://fooxx1y2/", result.spec()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 TEST_F(TemplateURLTest, URLRefTestEncoding) { | 97 TEST_F(TemplateURLTest, URLRefTestEncoding) { |
| 98 TemplateURL t_url; | 98 TemplateURL t_url; |
| 99 TemplateURLRef ref( | 99 TemplateURLRef ref( |
| 100 L"http://foo{searchTerms}x{inputEncoding?}y{outputEncoding?}a", 1, 2); | 100 L"http://foo{searchTerms}x{inputEncoding?}y{outputEncoding?}a", 1, 2); |
| 101 ASSERT_TRUE(ref.IsValid()); | 101 ASSERT_TRUE(ref.IsValid()); |
| 102 ASSERT_TRUE(ref.SupportsReplacement()); | 102 ASSERT_TRUE(ref.SupportsReplacement()); |
| 103 GURL result = ref.ReplaceSearchTerms(t_url, L"X", | 103 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"X", |
| 104 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 104 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 105 ASSERT_TRUE(result.is_valid()); | 105 ASSERT_TRUE(result.is_valid()); |
| 106 ASSERT_EQ("http://fooxxutf-8ya/", result.spec()); | 106 ASSERT_EQ("http://fooxxutf-8ya/", result.spec()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 TEST_F(TemplateURLTest, InputEncodingBeforeSearchTerm) { | 109 TEST_F(TemplateURLTest, InputEncodingBeforeSearchTerm) { |
| 110 TemplateURL t_url; | 110 TemplateURL t_url; |
| 111 TemplateURLRef ref( | 111 TemplateURLRef ref( |
| 112 L"http://foox{inputEncoding?}a{searchTerms}y{outputEncoding?}b", 1, 2); | 112 L"http://foox{inputEncoding?}a{searchTerms}y{outputEncoding?}b", 1, 2); |
| 113 ASSERT_TRUE(ref.IsValid()); | 113 ASSERT_TRUE(ref.IsValid()); |
| 114 ASSERT_TRUE(ref.SupportsReplacement()); | 114 ASSERT_TRUE(ref.SupportsReplacement()); |
| 115 GURL result = ref.ReplaceSearchTerms(t_url, L"X", | 115 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"X", |
| 116 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 116 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 117 ASSERT_TRUE(result.is_valid()); | 117 ASSERT_TRUE(result.is_valid()); |
| 118 ASSERT_EQ("http://fooxutf-8axyb/", result.spec()); | 118 ASSERT_EQ("http://fooxutf-8axyb/", result.spec()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 TEST_F(TemplateURLTest, URLRefTestEncoding2) { | 121 TEST_F(TemplateURLTest, URLRefTestEncoding2) { |
| 122 TemplateURL t_url; | 122 TemplateURL t_url; |
| 123 TemplateURLRef ref( | 123 TemplateURLRef ref( |
| 124 L"http://foo{searchTerms}x{inputEncoding}y{outputEncoding}a", 1, 2); | 124 L"http://foo{searchTerms}x{inputEncoding}y{outputEncoding}a", 1, 2); |
| 125 ASSERT_TRUE(ref.IsValid()); | 125 ASSERT_TRUE(ref.IsValid()); |
| 126 ASSERT_TRUE(ref.SupportsReplacement()); | 126 ASSERT_TRUE(ref.SupportsReplacement()); |
| 127 GURL result = ref.ReplaceSearchTerms(t_url, L"X", | 127 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"X", |
| 128 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 128 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 129 ASSERT_TRUE(result.is_valid()); | 129 ASSERT_TRUE(result.is_valid()); |
| 130 ASSERT_EQ("http://fooxxutf-8yutf-8a/", result.spec()); | 130 ASSERT_EQ("http://fooxxutf-8yutf-8a/", result.spec()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 TEST_F(TemplateURLTest, URLRefTermToWide) { | 133 TEST_F(TemplateURLTest, URLRefTermToWide) { |
| 134 struct ToWideCase { | 134 struct ToWideCase { |
| 135 const char* encoded_search_term; | 135 const char* encoded_search_term; |
| 136 const wchar_t* expected_decoded_term; | 136 const wchar_t* expected_decoded_term; |
| 137 } to_wide_cases[] = { | 137 } to_wide_cases[] = { |
| 138 {"hello+world", L"hello world"}, | 138 {"hello+world", L"hello world"}, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 WideToASCII(g_browser_process->GetApplicationLocale())); |
| 242 GURL result = 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. |
| 252 TEST_F(TemplateURLTest, ReplaceArbitrarySearchTerms) { | 252 TEST_F(TemplateURLTest, ReplaceArbitrarySearchTerms) { |
| 253 struct TestData { | 253 struct TestData { |
| 254 const std::string encoding; | 254 const std::string encoding; |
| 255 const std::wstring search_term; | 255 const std::wstring search_term; |
| 256 const std::wstring url; | 256 const std::wstring url; |
| 257 const std::string expected_result; | 257 const std::string expected_result; |
| 258 } data[] = { | 258 } data[] = { |
| 259 { "BIG5", L"\x60BD", L"http://foo/{searchTerms}{inputEncoding}", | 259 { "BIG5", L"\x60BD", L"http://foo/{searchTerms}{inputEncoding}", |
| 260 "http://foo/%B1~BIG5" }, | 260 "http://foo/%B1~BIG5" }, |
| 261 { "UTF-8", L"blah", L"http://foo/{searchTerms}{inputEncoding}", | 261 { "UTF-8", L"blah", L"http://foo/{searchTerms}{inputEncoding}", |
| 262 "http://foo/blahUTF-8" }, | 262 "http://foo/blahUTF-8" }, |
| 263 }; | 263 }; |
| 264 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { | 264 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { |
| 265 TemplateURL turl; | 265 TemplateURL turl; |
| 266 turl.add_input_encoding(data[i].encoding); | 266 turl.add_input_encoding(data[i].encoding); |
| 267 TemplateURLRef ref(data[i].url, 1, 2); | 267 TemplateURLRef ref(data[i].url, 1, 2); |
| 268 GURL result = ref.ReplaceSearchTerms(turl, data[i].search_term, | 268 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(turl, |
| 269 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 269 data[i].search_term, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, |
| 270 std::wstring()))); |
| 270 EXPECT_TRUE(result.is_valid()); | 271 EXPECT_TRUE(result.is_valid()); |
| 271 EXPECT_EQ(data[i].expected_result, result.spec()); | 272 EXPECT_EQ(data[i].expected_result, result.spec()); |
| 272 } | 273 } |
| 273 } | 274 } |
| 274 | 275 |
| 275 TEST_F(TemplateURLTest, Suggestions) { | 276 TEST_F(TemplateURLTest, Suggestions) { |
| 276 struct TestData { | 277 struct TestData { |
| 277 const int accepted_suggestion; | 278 const int accepted_suggestion; |
| 278 const std::wstring original_query_for_suggestion; | 279 const std::wstring original_query_for_suggestion; |
| 279 const std::string expected_result; | 280 const std::string expected_result; |
| 280 } data[] = { | 281 } data[] = { |
| 281 { TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring(), | 282 { TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring(), |
| 282 "http://bar/foo?q=foobar" }, | 283 "http://bar/foo?q=foobar" }, |
| 283 { TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, L"foo", | 284 { TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, L"foo", |
| 284 "http://bar/foo?q=foobar" }, | 285 "http://bar/foo?q=foobar" }, |
| 285 { TemplateURLRef::NO_SUGGESTION_CHOSEN, std::wstring(), | 286 { TemplateURLRef::NO_SUGGESTION_CHOSEN, std::wstring(), |
| 286 "http://bar/foo?aq=f&q=foobar" }, | 287 "http://bar/foo?aq=f&q=foobar" }, |
| 287 { TemplateURLRef::NO_SUGGESTION_CHOSEN, L"foo", | 288 { TemplateURLRef::NO_SUGGESTION_CHOSEN, L"foo", |
| 288 "http://bar/foo?aq=f&q=foobar" }, | 289 "http://bar/foo?aq=f&q=foobar" }, |
| 289 { 0, std::wstring(), "http://bar/foo?aq=0&oq=&q=foobar" }, | 290 { 0, std::wstring(), "http://bar/foo?aq=0&oq=&q=foobar" }, |
| 290 { 1, L"foo", "http://bar/foo?aq=1&oq=foo&q=foobar" }, | 291 { 1, L"foo", "http://bar/foo?aq=1&oq=foo&q=foobar" }, |
| 291 }; | 292 }; |
| 292 TemplateURL turl; | 293 TemplateURL turl; |
| 293 turl.add_input_encoding("UTF-8"); | 294 turl.add_input_encoding("UTF-8"); |
| 294 TemplateURLRef ref(L"http://bar/foo?{google:acceptedSuggestion}" | 295 TemplateURLRef ref(L"http://bar/foo?{google:acceptedSuggestion}" |
| 295 L"{google:originalQueryForSuggestion}q={searchTerms}", 1, 2); | 296 L"{google:originalQueryForSuggestion}q={searchTerms}", 1, 2); |
| 296 ASSERT_TRUE(ref.IsValid()); | 297 ASSERT_TRUE(ref.IsValid()); |
| 297 ASSERT_TRUE(ref.SupportsReplacement()); | 298 ASSERT_TRUE(ref.SupportsReplacement()); |
| 298 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { | 299 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { |
| 299 GURL result = ref.ReplaceSearchTerms(turl, L"foobar", | 300 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(turl, L"foobar", |
| 300 data[i].accepted_suggestion, data[i].original_query_for_suggestion); | 301 data[i].accepted_suggestion, data[i].original_query_for_suggestion))); |
| 301 EXPECT_TRUE(result.is_valid()); | 302 EXPECT_TRUE(result.is_valid()); |
| 302 EXPECT_EQ(data[i].expected_result, result.spec()); | 303 EXPECT_EQ(data[i].expected_result, result.spec()); |
| 303 } | 304 } |
| 304 } | 305 } |
| 305 | 306 |
| 306 TEST_F(TemplateURLTest, RLZ) { | 307 TEST_F(TemplateURLTest, RLZ) { |
| 307 #if defined(OS_WIN) | 308 #if defined(OS_WIN) |
| 308 RLZTracker::InitRlz(base::DIR_EXE); | 309 RLZTracker::InitRlz(base::DIR_EXE); |
| 309 #endif | 310 #endif |
| 310 std::wstring rlz_string; | 311 std::wstring rlz_string; |
| 311 RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz_string); | 312 RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz_string); |
| 312 | 313 |
| 313 TemplateURL t_url; | 314 TemplateURL t_url; |
| 314 TemplateURLRef ref(L"http://bar/?{google:RLZ}{searchTerms}", 1, 2); | 315 TemplateURLRef ref(L"http://bar/?{google:RLZ}{searchTerms}", 1, 2); |
| 315 ASSERT_TRUE(ref.IsValid()); | 316 ASSERT_TRUE(ref.IsValid()); |
| 316 ASSERT_TRUE(ref.SupportsReplacement()); | 317 ASSERT_TRUE(ref.SupportsReplacement()); |
| 317 GURL result = ref.ReplaceSearchTerms(t_url, L"x", | 318 GURL result = GURL(WideToUTF8(ref.ReplaceSearchTerms(t_url, L"x", |
| 318 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()); | 319 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()))); |
| 319 ASSERT_TRUE(result.is_valid()); | 320 ASSERT_TRUE(result.is_valid()); |
| 320 std::string expected_url = "http://bar/?"; | 321 std::string expected_url = "http://bar/?"; |
| 321 if (!rlz_string.empty()) { | 322 if (!rlz_string.empty()) { |
| 322 expected_url += "rlz=" + WideToUTF8(rlz_string) + "&"; | 323 expected_url += "rlz=" + WideToUTF8(rlz_string) + "&"; |
| 323 } | 324 } |
| 324 expected_url += "x"; | 325 expected_url += "x"; |
| 325 ASSERT_EQ(expected_url, result.spec()); | 326 ASSERT_EQ(expected_url, result.spec()); |
| 326 } | 327 } |
| 327 | 328 |
| 328 TEST_F(TemplateURLTest, HostAndSearchTermKey) { | 329 TEST_F(TemplateURLTest, HostAndSearchTermKey) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 EXPECT_FALSE(t_url.autogenerate_keyword()); | 386 EXPECT_FALSE(t_url.autogenerate_keyword()); |
| 386 t_url.set_keyword(L"foo"); | 387 t_url.set_keyword(L"foo"); |
| 387 EXPECT_EQ(L"foo", t_url.keyword()); | 388 EXPECT_EQ(L"foo", t_url.keyword()); |
| 388 t_url.set_autogenerate_keyword(true); | 389 t_url.set_autogenerate_keyword(true); |
| 389 EXPECT_TRUE(t_url.autogenerate_keyword()); | 390 EXPECT_TRUE(t_url.autogenerate_keyword()); |
| 390 EXPECT_EQ(L"google.com", t_url.keyword()); | 391 EXPECT_EQ(L"google.com", t_url.keyword()); |
| 391 t_url.set_keyword(L"foo"); | 392 t_url.set_keyword(L"foo"); |
| 392 EXPECT_FALSE(t_url.autogenerate_keyword()); | 393 EXPECT_FALSE(t_url.autogenerate_keyword()); |
| 393 EXPECT_EQ(L"foo", t_url.keyword()); | 394 EXPECT_EQ(L"foo", t_url.keyword()); |
| 394 } | 395 } |
| OLD | NEW |