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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 14259008: Instant Extended: Add prominent search term support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 expected_url += std::string(chrome::kSafeSearchSafeParameter) + "&" + 818 expected_url += std::string(chrome::kSafeSearchSafeParameter) + "&" +
819 chrome::kSafeSearchSsuiParameter; 819 chrome::kSafeSearchSsuiParameter;
820 GURL expected_with_parameters(expected_url); 820 GURL expected_with_parameters(expected_url);
821 EXPECT_EQ(expected_with_parameters, web_contents->GetURL()); 821 EXPECT_EQ(expected_with_parameters, web_contents->GetURL());
822 } 822 }
823 823
824 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) { 824 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) {
825 MakeRequestFail make_request_fail("search.example"); 825 MakeRequestFail make_request_fail("search.example");
826 826
827 chrome::EnableInstantExtendedAPIForTesting(); 827 chrome::EnableInstantExtendedAPIForTesting();
828 browser()->toolbar_model()->SetSupportsExtractionOfURLLikeSearchTerms(true);
828 829
829 // Verifies that a default search is made using the provider configured via 830 // Verifies that a default search is made using the provider configured via
830 // policy. Also checks that default search can be completely disabled. 831 // policy. Also checks that default search can be completely disabled.
831 const string16 kKeyword(ASCIIToUTF16("testsearch")); 832 const string16 kKeyword(ASCIIToUTF16("testsearch"));
832 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}"); 833 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}");
833 const std::string kInstantURL("http://does/not/exist"); 834 const std::string kInstantURL("http://does/not/exist");
834 const std::string kAlternateURL0( 835 const std::string kAlternateURL0(
835 "https://www.google.com/search#q={searchTerms}"); 836 "https://www.google.com/search#q={searchTerms}");
836 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}"); 837 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}");
837 const std::string kSearchTermsReplacementKey( 838 const std::string kSearchTermsReplacementKey(
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 GetDefaultVariationsServerURLForTesting(); 2080 GetDefaultVariationsServerURLForTesting();
2080 2081
2081 // Policy is applied and pref is already updated in local state. 2082 // Policy is applied and pref is already updated in local state.
2082 EXPECT_EQ(default_variations_url + "?restrict=restricted", 2083 EXPECT_EQ(default_variations_url + "?restrict=restricted",
2083 chrome_variations::VariationsService::GetVariationsServerURL( 2084 chrome_variations::VariationsService::GetVariationsServerURL(
2084 g_browser_process->local_state()).spec()); 2085 g_browser_process->local_state()).spec());
2085 } 2086 }
2086 #endif 2087 #endif
2087 2088
2088 } // namespace policy 2089 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698