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

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

Powered by Google App Engine
This is Rietveld 408576698