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

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

Issue 73613002: InstantExtended: remove old flags, add new flag for query extraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 7 years, 1 month 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 <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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 std::string expected_url("http://google.com/?"); 982 std::string expected_url("http://google.com/?");
983 expected_url += std::string(chrome::kSafeSearchSafeParameter) + "&" + 983 expected_url += std::string(chrome::kSafeSearchSafeParameter) + "&" +
984 chrome::kSafeSearchSsuiParameter; 984 chrome::kSafeSearchSsuiParameter;
985 GURL expected_with_parameters(expected_url); 985 GURL expected_with_parameters(expected_url);
986 EXPECT_EQ(expected_with_parameters, web_contents->GetURL()); 986 EXPECT_EQ(expected_with_parameters, web_contents->GetURL());
987 } 987 }
988 988
989 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) { 989 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) {
990 MakeRequestFail make_request_fail("search.example"); 990 MakeRequestFail make_request_fail("search.example");
991 991
992 chrome::EnableInstantExtendedAPIForTesting(); 992 chrome::EnableQueryExtractionForTesting();
993 993
994 // Verifies that a default search is made using the provider configured via 994 // Verifies that a default search is made using the provider configured via
995 // policy. Also checks that default search can be completely disabled. 995 // policy. Also checks that default search can be completely disabled.
996 const string16 kKeyword(ASCIIToUTF16("testsearch")); 996 const string16 kKeyword(ASCIIToUTF16("testsearch"));
997 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}"); 997 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}");
998 const std::string kInstantURL("http://does/not/exist"); 998 const std::string kInstantURL("http://does/not/exist");
999 const std::string kAlternateURL0( 999 const std::string kAlternateURL0(
1000 "https://www.google.com/search#q={searchTerms}"); 1000 "https://www.google.com/search#q={searchTerms}");
1001 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}"); 1001 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}");
1002 const std::string kSearchTermsReplacementKey( 1002 const std::string kSearchTermsReplacementKey(
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after
2830 chrome_variations::VariationsService::GetVariationsServerURL( 2830 chrome_variations::VariationsService::GetVariationsServerURL(
2831 g_browser_process->local_state()); 2831 g_browser_process->local_state());
2832 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); 2832 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true));
2833 std::string value; 2833 std::string value;
2834 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); 2834 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value));
2835 EXPECT_EQ("restricted", value); 2835 EXPECT_EQ("restricted", value);
2836 } 2836 }
2837 #endif 2837 #endif
2838 2838
2839 } // namespace policy 2839 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/search_provider_unittest.cc ('k') | chrome/browser/search/instant_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698