| 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/prefs/scoped_user_pref_update.h" | 7 #include "base/prefs/scoped_user_pref_update.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/extension_service_unittest.h" | 10 #include "chrome/browser/extensions/extension_service_unittest.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 318 |
| 319 // Load a content pack. | 319 // Load a content pack. |
| 320 scoped_refptr<extensions::UnpackedInstaller> installer( | 320 scoped_refptr<extensions::UnpackedInstaller> installer( |
| 321 extensions::UnpackedInstaller::Create(service_)); | 321 extensions::UnpackedInstaller::Create(service_)); |
| 322 installer->set_prompt_for_plugins(false); | 322 installer->set_prompt_for_plugins(false); |
| 323 base::FilePath test_data_dir; | 323 base::FilePath test_data_dir; |
| 324 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)); | 324 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)); |
| 325 base::FilePath extension_path = | 325 base::FilePath extension_path = |
| 326 test_data_dir.AppendASCII("extensions/managed_mode/content_pack"); | 326 test_data_dir.AppendASCII("extensions/managed_mode/content_pack"); |
| 327 content::WindowedNotificationObserver extension_load_observer( | 327 content::WindowedNotificationObserver extension_load_observer( |
| 328 chrome::NOTIFICATION_EXTENSION_LOADED, | 328 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
| 329 content::Source<Profile>(profile_.get())); | 329 content::Source<Profile>(profile_.get())); |
| 330 installer->Load(extension_path); | 330 installer->Load(extension_path); |
| 331 extension_load_observer.Wait(); | 331 extension_load_observer.Wait(); |
| 332 observer.Wait(); | 332 observer.Wait(); |
| 333 content::Details<extensions::Extension> details = | 333 content::Details<extensions::Extension> details = |
| 334 extension_load_observer.details(); | 334 extension_load_observer.details(); |
| 335 scoped_refptr<extensions::Extension> extension = | 335 scoped_refptr<extensions::Extension> extension = |
| 336 make_scoped_refptr(details.ptr()); | 336 make_scoped_refptr(details.ptr()); |
| 337 ASSERT_TRUE(extension.get()); | 337 ASSERT_TRUE(extension.get()); |
| 338 | 338 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 site_lists[0]->GetSites(&sites); | 391 site_lists[0]->GetSites(&sites); |
| 392 ASSERT_EQ(1u, sites.size()); | 392 ASSERT_EQ(1u, sites.size()); |
| 393 EXPECT_EQ(base::ASCIIToUTF16("Moose"), sites[0].name); | 393 EXPECT_EQ(base::ASCIIToUTF16("Moose"), sites[0].name); |
| 394 | 394 |
| 395 EXPECT_EQ(ManagedModeURLFilter::WARN, | 395 EXPECT_EQ(ManagedModeURLFilter::WARN, |
| 396 url_filter->GetFilteringBehaviorForURL(example_url)); | 396 url_filter->GetFilteringBehaviorForURL(example_url)); |
| 397 EXPECT_EQ(ManagedModeURLFilter::ALLOW, | 397 EXPECT_EQ(ManagedModeURLFilter::ALLOW, |
| 398 url_filter->GetFilteringBehaviorForURL(moose_url)); | 398 url_filter->GetFilteringBehaviorForURL(moose_url)); |
| 399 } | 399 } |
| 400 #endif // !defined(OS_ANDROID) | 400 #endif // !defined(OS_ANDROID) |
| OLD | NEW |