| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/rlz/rlz.h" | 9 #include "chrome/browser/rlz/rlz.h" |
| 10 #include "chrome/browser/search_engines/search_terms_data.h" | 10 #include "chrome/browser/search_engines/search_terms_data.h" |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 EXPECT_TRUE(url.HasSearchTermsReplacementKey( | 917 EXPECT_TRUE(url.HasSearchTermsReplacementKey( |
| 918 GURL("http://google.com/?q=something#espv=1"))); | 918 GURL("http://google.com/?q=something#espv=1"))); |
| 919 | 919 |
| 920 // This does not ensure the domain matches. | 920 // This does not ensure the domain matches. |
| 921 EXPECT_TRUE(url.HasSearchTermsReplacementKey( | 921 EXPECT_TRUE(url.HasSearchTermsReplacementKey( |
| 922 GURL("http://bing.com/?espv"))); | 922 GURL("http://bing.com/?espv"))); |
| 923 | 923 |
| 924 EXPECT_TRUE(url.HasSearchTermsReplacementKey( | 924 EXPECT_TRUE(url.HasSearchTermsReplacementKey( |
| 925 GURL("http://bing.com/#espv"))); | 925 GURL("http://bing.com/#espv"))); |
| 926 } | 926 } |
| 927 |
| 928 TEST_F(TemplateURLTest, SupportsInstantExtendedParam) { |
| 929 TemplateURLData data; |
| 930 data.SetURL("http://google.com/?q={searchTerms}"); |
| 931 data.instant_url = "http://google.com/instant#q={searchTerms}" |
| 932 "{google:instantExtendedEnabledParameter}"; |
| 933 TemplateURL url(NULL, data); |
| 934 |
| 935 EXPECT_TRUE(url.SupportsInstantExtendedParam()); |
| 936 |
| 937 TemplateURLData data2; |
| 938 data2.SetURL("http://google.com/?q={searchTerms}"); |
| 939 data2.instant_url = "http://google.com/instant#q={searchTerms}"; |
| 940 TemplateURL url2(NULL, data2); |
| 941 |
| 942 EXPECT_FALSE(url2.SupportsInstantExtendedParam()); |
| 943 } |
| OLD | NEW |