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

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

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix unit test (the model was already loaded) Created 3 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 const std::string kAlternateURL1("http://search.example/#q={searchTerms}"); 966 const std::string kAlternateURL1("http://search.example/#q={searchTerms}");
967 const std::string kSearchTermsReplacementKey("zekey"); 967 const std::string kSearchTermsReplacementKey("zekey");
968 const std::string kImageURL("http://test.com/searchbyimage/upload"); 968 const std::string kImageURL("http://test.com/searchbyimage/upload");
969 const std::string kImageURLPostParams( 969 const std::string kImageURLPostParams(
970 "image_content=content,image_url=http://test.com/test.png"); 970 "image_content=content,image_url=http://test.com/test.png");
971 const std::string kNewTabURL("http://search.example/newtab"); 971 const std::string kNewTabURL("http://search.example/newtab");
972 972
973 TemplateURLService* service = TemplateURLServiceFactory::GetForProfile( 973 TemplateURLService* service = TemplateURLServiceFactory::GetForProfile(
974 browser()->profile()); 974 browser()->profile());
975 search_test_utils::WaitForTemplateURLServiceToLoad(service); 975 search_test_utils::WaitForTemplateURLServiceToLoad(service);
976 TemplateURL* default_search = service->GetDefaultSearchProvider(); 976 const TemplateURL* default_search = service->GetDefaultSearchProvider();
977 ASSERT_TRUE(default_search); 977 ASSERT_TRUE(default_search);
978 EXPECT_NE(kKeyword, default_search->keyword()); 978 EXPECT_NE(kKeyword, default_search->keyword());
979 EXPECT_NE(kSearchURL, default_search->url()); 979 EXPECT_NE(kSearchURL, default_search->url());
980 EXPECT_NE(kInstantURL, default_search->instant_url()); 980 EXPECT_NE(kInstantURL, default_search->instant_url());
981 EXPECT_FALSE( 981 EXPECT_FALSE(
982 default_search->alternate_urls().size() == 2 && 982 default_search->alternate_urls().size() == 2 &&
983 default_search->alternate_urls()[0] == kAlternateURL0 && 983 default_search->alternate_urls()[0] == kAlternateURL0 &&
984 default_search->alternate_urls()[1] == kAlternateURL1 && 984 default_search->alternate_urls()[1] == kAlternateURL1 &&
985 default_search->search_terms_replacement_key() == 985 default_search->search_terms_replacement_key() ==
986 kSearchTermsReplacementKey && 986 kSearchTermsReplacementKey &&
(...skipping 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after
4483 4483
4484 SetEmptyPolicy(); 4484 SetEmptyPolicy();
4485 // Policy not set. 4485 // Policy not set.
4486 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4486 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4487 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4487 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4488 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4488 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4489 } 4489 }
4490 #endif // defined(OS_CHROMEOS) 4490 #endif // defined(OS_CHROMEOS)
4491 4491
4492 } // namespace policy 4492 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698