| 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 "base/path_service.h" | 5 #include "base/path_service.h" |
| 6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_service_unittest.h" | 8 #include "chrome/browser/extensions/extension_service_unittest.h" |
| 9 #include "chrome/browser/extensions/unpacked_installer.h" | 9 #include "chrome/browser/extensions/unpacked_installer.h" |
| 10 #include "chrome/browser/managed_mode/managed_user_service.h" | 10 #include "chrome/browser/managed_mode/managed_user_service.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
| 13 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
| 14 #include "chrome/common/extensions/api/managed_mode_private/managed_mode_handler
.h" | |
| 15 #include "chrome/common/extensions/manifest_handler.h" | |
| 16 #include "chrome/common/extensions/manifest_handlers/requirements_handler.h" | |
| 17 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
| 19 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 18 |
| 22 using content::MessageLoopRunner; | 19 using content::MessageLoopRunner; |
| 23 | 20 |
| 24 namespace { | 21 namespace { |
| 25 | 22 |
| 26 class ManagedModeURLFilterObserver : public ManagedModeURLFilter::Observer { | 23 class ManagedModeURLFilterObserver : public ManagedModeURLFilter::Observer { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 144 } |
| 148 | 145 |
| 149 class ManagedUserServiceExtensionTest : public ExtensionServiceTestBase { | 146 class ManagedUserServiceExtensionTest : public ExtensionServiceTestBase { |
| 150 public: | 147 public: |
| 151 ManagedUserServiceExtensionTest() {} | 148 ManagedUserServiceExtensionTest() {} |
| 152 virtual ~ManagedUserServiceExtensionTest() {} | 149 virtual ~ManagedUserServiceExtensionTest() {} |
| 153 | 150 |
| 154 virtual void SetUp() OVERRIDE { | 151 virtual void SetUp() OVERRIDE { |
| 155 ExtensionServiceTestBase::SetUp(); | 152 ExtensionServiceTestBase::SetUp(); |
| 156 InitializeEmptyExtensionService(); | 153 InitializeEmptyExtensionService(); |
| 157 (new extensions::RequirementsHandler)->Register(); | |
| 158 (new extensions::ManagedModeHandler)->Register(); | |
| 159 } | 154 } |
| 160 | 155 |
| 161 virtual void TearDown() OVERRIDE { | 156 virtual void TearDown() OVERRIDE { |
| 162 extensions::ManifestHandler::ClearRegistryForTesting(); | |
| 163 ExtensionServiceTestBase::TearDown(); | 157 ExtensionServiceTestBase::TearDown(); |
| 164 } | 158 } |
| 165 | 159 |
| 166 protected: | 160 protected: |
| 167 ScopedVector<ManagedModeSiteList> GetActiveSiteLists( | 161 ScopedVector<ManagedModeSiteList> GetActiveSiteLists( |
| 168 ManagedUserService* managed_user_service) { | 162 ManagedUserService* managed_user_service) { |
| 169 return managed_user_service->GetActiveSiteLists(); | 163 return managed_user_service->GetActiveSiteLists(); |
| 170 } | 164 } |
| 171 }; | 165 }; |
| 172 | 166 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 287 |
| 294 EXPECT_EQ(ManagedModeURLFilter::WARN, | 288 EXPECT_EQ(ManagedModeURLFilter::WARN, |
| 295 url_filter->GetFilteringBehaviorForURL(example_url)); | 289 url_filter->GetFilteringBehaviorForURL(example_url)); |
| 296 #if defined(ENABLE_CONFIGURATION_POLICY) | 290 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 297 EXPECT_EQ(ManagedModeURLFilter::ALLOW, | 291 EXPECT_EQ(ManagedModeURLFilter::ALLOW, |
| 298 url_filter->GetFilteringBehaviorForURL(moose_url)); | 292 url_filter->GetFilteringBehaviorForURL(moose_url)); |
| 299 #endif | 293 #endif |
| 300 } | 294 } |
| 301 | 295 |
| 302 #endif // OS_CHROMEOS | 296 #endif // OS_CHROMEOS |
| OLD | NEW |