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

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

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up test. Created 7 years, 2 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 <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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 std::string expected_url("http://google.com/?"); 989 std::string expected_url("http://google.com/?");
990 expected_url += std::string(chrome::kSafeSearchSafeParameter) + "&" + 990 expected_url += std::string(chrome::kSafeSearchSafeParameter) + "&" +
991 chrome::kSafeSearchSsuiParameter; 991 chrome::kSafeSearchSsuiParameter;
992 GURL expected_with_parameters(expected_url); 992 GURL expected_with_parameters(expected_url);
993 EXPECT_EQ(expected_with_parameters, web_contents->GetURL()); 993 EXPECT_EQ(expected_with_parameters, web_contents->GetURL());
994 } 994 }
995 995
996 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) { 996 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) {
997 MakeRequestFail make_request_fail("search.example"); 997 MakeRequestFail make_request_fail("search.example");
998 998
999 chrome::EnableInstantExtendedAPIForTesting(); 999 chrome::EnableQueryExtractionForTesting();
1000 1000
1001 // Verifies that a default search is made using the provider configured via 1001 // Verifies that a default search is made using the provider configured via
1002 // policy. Also checks that default search can be completely disabled. 1002 // policy. Also checks that default search can be completely disabled.
1003 const string16 kKeyword(ASCIIToUTF16("testsearch")); 1003 const string16 kKeyword(ASCIIToUTF16("testsearch"));
1004 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}"); 1004 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}");
1005 const std::string kInstantURL("http://does/not/exist"); 1005 const std::string kInstantURL("http://does/not/exist");
1006 const std::string kAlternateURL0( 1006 const std::string kAlternateURL0(
1007 "https://www.google.com/search#q={searchTerms}"); 1007 "https://www.google.com/search#q={searchTerms}");
1008 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}"); 1008 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}");
1009 const std::string kSearchTermsReplacementKey( 1009 const std::string kSearchTermsReplacementKey(
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after
2727 chrome_variations::VariationsService::GetVariationsServerURL( 2727 chrome_variations::VariationsService::GetVariationsServerURL(
2728 g_browser_process->local_state()); 2728 g_browser_process->local_state());
2729 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); 2729 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true));
2730 std::string value; 2730 std::string value;
2731 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); 2731 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value));
2732 EXPECT_EQ("restricted", value); 2732 EXPECT_EQ("restricted", value);
2733 } 2733 }
2734 #endif 2734 #endif
2735 2735
2736 } // namespace policy 2736 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698