| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/supervised_user/supervised_user_resource_throttle.h" | 5 #include "chrome/browser/supervised_user/supervised_user_resource_throttle.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/supervised_user/supervised_user_constants.h" | 10 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Tests that showing the blocking interstitial for a WebContents without a | 51 // Tests that showing the blocking interstitial for a WebContents without a |
| 52 // SupervisedUserNavigationObserver doesn't crash. | 52 // SupervisedUserNavigationObserver doesn't crash. |
| 53 IN_PROC_BROWSER_TEST_F(SupervisedUserResourceThrottleTest, | 53 IN_PROC_BROWSER_TEST_F(SupervisedUserResourceThrottleTest, |
| 54 NoNavigationObserverBlock) { | 54 NoNavigationObserverBlock) { |
| 55 Profile* profile = browser()->profile(); | 55 Profile* profile = browser()->profile(); |
| 56 SupervisedUserSettingsService* supervised_user_settings_service = | 56 SupervisedUserSettingsService* supervised_user_settings_service = |
| 57 SupervisedUserSettingsServiceFactory::GetForProfile(profile); | 57 SupervisedUserSettingsServiceFactory::GetForProfile(profile); |
| 58 supervised_user_settings_service->SetLocalSetting( | 58 supervised_user_settings_service->SetLocalSetting( |
| 59 supervised_users::kContentPackDefaultFilteringBehavior, | 59 supervised_users::kContentPackDefaultFilteringBehavior, |
| 60 scoped_ptr<base::Value>( | 60 std::unique_ptr<base::Value>( |
| 61 new base::FundamentalValue(SupervisedUserURLFilter::BLOCK))); | 61 new base::FundamentalValue(SupervisedUserURLFilter::BLOCK))); |
| 62 | 62 |
| 63 scoped_ptr<WebContents> web_contents( | 63 std::unique_ptr<WebContents> web_contents( |
| 64 WebContents::Create(WebContents::CreateParams(profile))); | 64 WebContents::Create(WebContents::CreateParams(profile))); |
| 65 NavigationController& controller = web_contents->GetController(); | 65 NavigationController& controller = web_contents->GetController(); |
| 66 content::TestNavigationObserver observer(web_contents.get()); | 66 content::TestNavigationObserver observer(web_contents.get()); |
| 67 controller.LoadURL(GURL("http://www.example.com"), content::Referrer(), | 67 controller.LoadURL(GURL("http://www.example.com"), content::Referrer(), |
| 68 ui::PAGE_TRANSITION_TYPED, std::string()); | 68 ui::PAGE_TRANSITION_TYPED, std::string()); |
| 69 observer.Wait(); | 69 observer.Wait(); |
| 70 content::NavigationEntry* entry = controller.GetActiveEntry(); | 70 content::NavigationEntry* entry = controller.GetActiveEntry(); |
| 71 ASSERT_TRUE(entry); | 71 ASSERT_TRUE(entry); |
| 72 EXPECT_EQ(content::PAGE_TYPE_INTERSTITIAL, entry->GetPageType()); | 72 EXPECT_EQ(content::PAGE_TYPE_INTERSTITIAL, entry->GetPageType()); |
| 73 } | 73 } |
| OLD | NEW |