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

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

Issue 1260033003: Partially componentize //chrome/browser/search/search.{h,cc} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on iOS Created 5 years, 4 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
« no previous file with comments | « chrome/browser/favicon/favicon_utils.cc ('k') | chrome/browser/prerender/prerender_manager.cc » ('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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 #include "components/content_settings/core/common/content_settings_pattern.h" 91 #include "components/content_settings/core/common/content_settings_pattern.h"
92 #include "components/infobars/core/infobar.h" 92 #include "components/infobars/core/infobar.h"
93 #include "components/omnibox/browser/autocomplete_controller.h" 93 #include "components/omnibox/browser/autocomplete_controller.h"
94 #include "components/policy/core/browser/browser_policy_connector.h" 94 #include "components/policy/core/browser/browser_policy_connector.h"
95 #include "components/policy/core/common/external_data_fetcher.h" 95 #include "components/policy/core/common/external_data_fetcher.h"
96 #include "components/policy/core/common/mock_configuration_policy_provider.h" 96 #include "components/policy/core/common/mock_configuration_policy_provider.h"
97 #include "components/policy/core/common/policy_map.h" 97 #include "components/policy/core/common/policy_map.h"
98 #include "components/policy/core/common/policy_pref_names.h" 98 #include "components/policy/core/common/policy_pref_names.h"
99 #include "components/policy/core/common/policy_service.h" 99 #include "components/policy/core/common/policy_service.h"
100 #include "components/policy/core/common/policy_service_impl.h" 100 #include "components/policy/core/common/policy_service_impl.h"
101 #include "components/search/search.h"
101 #include "components/search_engines/template_url.h" 102 #include "components/search_engines/template_url.h"
102 #include "components/search_engines/template_url_service.h" 103 #include "components/search_engines/template_url_service.h"
103 #include "components/translate/core/browser/language_state.h" 104 #include "components/translate/core/browser/language_state.h"
104 #include "components/translate/core/browser/translate_infobar_delegate.h" 105 #include "components/translate/core/browser/translate_infobar_delegate.h"
105 #include "content/public/browser/browser_child_process_host_iterator.h" 106 #include "content/public/browser/browser_child_process_host_iterator.h"
106 #include "content/public/browser/browser_context.h" 107 #include "content/public/browser/browser_context.h"
107 #include "content/public/browser/browser_thread.h" 108 #include "content/public/browser/browser_thread.h"
108 #include "content/public/browser/child_process_data.h" 109 #include "content/public/browser/child_process_data.h"
109 #include "content/public/browser/download_item.h" 110 #include "content/public/browser/download_item.h"
110 #include "content/public/browser/download_manager.h" 111 #include "content/public/browser/download_manager.h"
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 EXPECT_EQ(youtube == 1 || legacy_enabled, 1174 EXPECT_EQ(youtube == 1 || legacy_enabled,
1174 prefs->GetBoolean(prefs::kForceYouTubeSafetyMode)); 1175 prefs->GetBoolean(prefs::kForceYouTubeSafetyMode));
1175 1176
1176 CheckSafeSearch(google == 1 || legacy_enabled); 1177 CheckSafeSearch(google == 1 || legacy_enabled);
1177 } 1178 }
1178 } 1179 }
1179 1180
1180 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) { 1181 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) {
1181 MakeRequestFail make_request_fail("search.example"); 1182 MakeRequestFail make_request_fail("search.example");
1182 1183
1183 chrome::EnableQueryExtractionForTesting(); 1184 search::EnableQueryExtractionForTesting();
1184 1185
1185 // Verifies that a default search is made using the provider configured via 1186 // Verifies that a default search is made using the provider configured via
1186 // policy. Also checks that default search can be completely disabled. 1187 // policy. Also checks that default search can be completely disabled.
1187 const base::string16 kKeyword(base::ASCIIToUTF16("testsearch")); 1188 const base::string16 kKeyword(base::ASCIIToUTF16("testsearch"));
1188 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}"); 1189 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}");
1189 const std::string kInstantURL("http://does/not/exist"); 1190 const std::string kInstantURL("http://does/not/exist");
1190 const std::string kAlternateURL0( 1191 const std::string kAlternateURL0(
1191 "https://www.google.com/search#q={searchTerms}"); 1192 "https://www.google.com/search#q={searchTerms}");
1192 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}"); 1193 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}");
1193 const std::string kSearchTermsReplacementKey( 1194 const std::string kSearchTermsReplacementKey(
(...skipping 2666 matching lines...) Expand 10 before | Expand all | Expand 10 after
3860 3861
3861 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, 3862 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest,
3862 HardwareAccelerationDisabled) { 3863 HardwareAccelerationDisabled) {
3863 // Verifies that hardware acceleration can be disabled with policy. 3864 // Verifies that hardware acceleration can be disabled with policy.
3864 EXPECT_FALSE( 3865 EXPECT_FALSE(
3865 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); 3866 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr));
3866 } 3867 }
3867 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 3868 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
3868 3869
3869 } // namespace policy 3870 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_utils.cc ('k') | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698