| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 436 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 437 TEST_F(SearchTest, UseLocalNTPIfNTPURLIsBlockedForSupervisedUser) { | 437 TEST_F(SearchTest, UseLocalNTPIfNTPURLIsBlockedForSupervisedUser) { |
| 438 // Block access to foo.com in the URL filter. | 438 // Block access to foo.com in the URL filter. |
| 439 SupervisedUserService* supervised_user_service = | 439 SupervisedUserService* supervised_user_service = |
| 440 SupervisedUserServiceFactory::GetForProfile(profile()); | 440 SupervisedUserServiceFactory::GetForProfile(profile()); |
| 441 SupervisedUserURLFilter* url_filter = | 441 SupervisedUserURLFilter* url_filter = |
| 442 supervised_user_service->GetURLFilterForUIThread(); | 442 supervised_user_service->GetURLFilterForUIThread(); |
| 443 std::map<std::string, bool> hosts; | 443 std::map<std::string, bool> hosts; |
| 444 hosts["foo.com"] = false; | 444 hosts["foo.com"] = false; |
| 445 url_filter->SetManualHosts(&hosts); | 445 url_filter->SetManualHosts(&hosts); |
| 446 url_filter->SetEnabled(true); |
| 446 | 447 |
| 447 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), | 448 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), |
| 448 GetNewTabPageURL(profile())); | 449 GetNewTabPageURL(profile())); |
| 449 GURL new_tab_url(chrome::kChromeUINewTabURL); | 450 GURL new_tab_url(chrome::kChromeUINewTabURL); |
| 450 EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile())); | 451 EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile())); |
| 451 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url); | 452 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url); |
| 452 EXPECT_EQ(GURL(), GetInstantURL(profile(), false)); | 453 EXPECT_EQ(GURL(), GetInstantURL(profile(), false)); |
| 453 } | 454 } |
| 454 #endif | 455 #endif |
| 455 | 456 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 TemplateURLRef::SearchTermsArgs search_terms_args(base::ASCIIToUTF16("foo")); | 669 TemplateURLRef::SearchTermsArgs search_terms_args(base::ASCIIToUTF16("foo")); |
| 669 GURL result(template_url_->url_ref().ReplaceSearchTerms( | 670 GURL result(template_url_->url_ref().ReplaceSearchTerms( |
| 670 search_terms_args, UIThreadSearchTermsData(profile()))); | 671 search_terms_args, UIThreadSearchTermsData(profile()))); |
| 671 ASSERT_TRUE(result.is_valid()); | 672 ASSERT_TRUE(result.is_valid()); |
| 672 // Query extraction is disabled. Make sure | 673 // Query extraction is disabled. Make sure |
| 673 // {google:instantExtendedEnabledParameter} is not set in the search URL. | 674 // {google:instantExtendedEnabledParameter} is not set in the search URL. |
| 674 EXPECT_EQ("http://www.google.com/search?q=foo", result.spec()); | 675 EXPECT_EQ("http://www.google.com/search?q=foo", result.spec()); |
| 675 } | 676 } |
| 676 | 677 |
| 677 } // namespace search | 678 } // namespace search |
| OLD | NEW |