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

Side by Side Diff: chrome/browser/search/search_unittest.cc

Issue 335833003: Rename "managed (mode|user)" to "supervised user" (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments (+ a few other cleanups) Created 6 years, 6 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
« no previous file with comments | « chrome/browser/search/search.cc ('k') | chrome/browser/signin/chrome_signin_client.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/metrics/field_trial.h" 6 #include "base/metrics/field_trial.h"
7 #include "base/metrics/histogram_base.h" 7 #include "base/metrics/histogram_base.h"
8 #include "base/metrics/histogram_samples.h" 8 #include "base/metrics/histogram_samples.h"
9 #include "base/metrics/statistics_recorder.h" 9 #include "base/metrics/statistics_recorder.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "chrome/browser/managed_mode/managed_mode_url_filter.h"
13 #include "chrome/browser/managed_mode/managed_user_service.h"
14 #include "chrome/browser/managed_mode/managed_user_service_factory.h"
15 #include "chrome/browser/search/instant_service.h" 12 #include "chrome/browser/search/instant_service.h"
16 #include "chrome/browser/search/instant_service_factory.h" 13 #include "chrome/browser/search/instant_service_factory.h"
17 #include "chrome/browser/search/search.h" 14 #include "chrome/browser/search/search.h"
18 #include "chrome/browser/search_engines/template_url_service.h" 15 #include "chrome/browser/search_engines/template_url_service.h"
19 #include "chrome/browser/search_engines/template_url_service_factory.h" 16 #include "chrome/browser/search_engines/template_url_service_factory.h"
20 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" 17 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
18 #include "chrome/browser/supervised_user/supervised_user_service.h"
19 #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
20 #include "chrome/browser/supervised_user/supervised_user_url_filter.h"
21 #include "chrome/browser/ui/tabs/tab_strip_model.h" 21 #include "chrome/browser/ui/tabs/tab_strip_model.h"
22 #include "chrome/common/chrome_switches.h" 22 #include "chrome/common/chrome_switches.h"
23 #include "chrome/common/pref_names.h" 23 #include "chrome/common/pref_names.h"
24 #include "chrome/common/url_constants.h" 24 #include "chrome/common/url_constants.h"
25 #include "chrome/test/base/browser_with_test_window_test.h" 25 #include "chrome/test/base/browser_with_test_window_test.h"
26 #include "chrome/test/base/ui_test_utils.h" 26 #include "chrome/test/base/ui_test_utils.h"
27 #include "components/google/core/browser/google_switches.h" 27 #include "components/google/core/browser/google_switches.h"
28 #include "components/variations/entropy_provider.h" 28 #include "components/variations/entropy_provider.h"
29 #include "content/public/browser/render_process_host.h" 29 #include "content/public/browser/render_process_host.h"
30 #include "content/public/browser/render_view_host.h" 30 #include "content/public/browser/render_view_host.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 SetSearchProvider(false, true); 546 SetSearchProvider(false, true);
547 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), 547 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl),
548 chrome::GetNewTabPageURL(profile())); 548 chrome::GetNewTabPageURL(profile()));
549 GURL new_tab_url(chrome::kChromeUINewTabURL); 549 GURL new_tab_url(chrome::kChromeUINewTabURL);
550 EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile())); 550 EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile()));
551 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url); 551 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url);
552 } 552 }
553 553
554 TEST_F(SearchTest, UseLocalNTPIfNTPURLIsBlockedForSupervisedUser) { 554 TEST_F(SearchTest, UseLocalNTPIfNTPURLIsBlockedForSupervisedUser) {
555 // Block access to foo.com in the URL filter. 555 // Block access to foo.com in the URL filter.
556 ManagedUserService* managed_user_service = 556 SupervisedUserService* supervised_user_service =
557 ManagedUserServiceFactory::GetForProfile(profile()); 557 SupervisedUserServiceFactory::GetForProfile(profile());
558 ManagedModeURLFilter* url_filter = 558 SupervisedUserURLFilter* url_filter =
559 managed_user_service->GetURLFilterForUIThread(); 559 supervised_user_service->GetURLFilterForUIThread();
560 std::map<std::string, bool> hosts; 560 std::map<std::string, bool> hosts;
561 hosts["foo.com"] = false; 561 hosts["foo.com"] = false;
562 url_filter->SetManualHosts(&hosts); 562 url_filter->SetManualHosts(&hosts);
563 563
564 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), 564 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl),
565 chrome::GetNewTabPageURL(profile())); 565 chrome::GetNewTabPageURL(profile()));
566 GURL new_tab_url(chrome::kChromeUINewTabURL); 566 GURL new_tab_url(chrome::kChromeUINewTabURL);
567 EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile())); 567 EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile()));
568 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url); 568 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url);
569 EXPECT_EQ(GURL(), GetInstantURL(profile(), kDisableStartMargin, false)); 569 EXPECT_EQ(GURL(), GetInstantURL(profile(), kDisableStartMargin, false));
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 } 1169 }
1170 1170
1171 TEST_F(OriginChipTest, CommandLineOnSrp) { 1171 TEST_F(OriginChipTest, CommandLineOnSrp) {
1172 CommandLine::ForCurrentProcess()->AppendSwitch( 1172 CommandLine::ForCurrentProcess()->AppendSwitch(
1173 switches::kEnableOriginChipOnSrp); 1173 switches::kEnableOriginChipOnSrp);
1174 EXPECT_TRUE(ShouldDisplayOriginChip()); 1174 EXPECT_TRUE(ShouldDisplayOriginChip());
1175 EXPECT_EQ(ORIGIN_CHIP_ON_SRP, GetOriginChipCondition()); 1175 EXPECT_EQ(ORIGIN_CHIP_ON_SRP, GetOriginChipCondition());
1176 } 1176 }
1177 1177
1178 } // namespace chrome 1178 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/search/search.cc ('k') | chrome/browser/signin/chrome_signin_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698