Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: chrome/browser/search_engines/template_url_unittest.cc

Issue 11884037: InstantExtended: Bail on TemplateURLs with no espv. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Braces. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698