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 "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.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 // Load a content pack. | 342 // Load a content pack. |
343 scoped_refptr<extensions::UnpackedInstaller> installer( | 343 scoped_refptr<extensions::UnpackedInstaller> installer( |
344 extensions::UnpackedInstaller::Create(service_)); | 344 extensions::UnpackedInstaller::Create(service_)); |
345 installer->set_prompt_for_plugins(false); | 345 installer->set_prompt_for_plugins(false); |
346 base::FilePath test_data_dir; | 346 base::FilePath test_data_dir; |
347 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)); | 347 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)); |
348 base::FilePath extension_path = | 348 base::FilePath extension_path = |
349 test_data_dir.AppendASCII("extensions/supervised_user/content_pack"); | 349 test_data_dir.AppendASCII("extensions/supervised_user/content_pack"); |
350 content::WindowedNotificationObserver extension_load_observer( | 350 content::WindowedNotificationObserver extension_load_observer( |
351 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 351 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
352 content::Source<Profile>(profile_.get())); | 352 content::Source<Profile>(profile_.get())); |
353 installer->Load(extension_path); | 353 installer->Load(extension_path); |
354 extension_load_observer.Wait(); | 354 extension_load_observer.Wait(); |
355 observer.Wait(); | 355 observer.Wait(); |
356 content::Details<extensions::Extension> details = | 356 content::Details<extensions::Extension> details = |
357 extension_load_observer.details(); | 357 extension_load_observer.details(); |
358 scoped_refptr<extensions::Extension> extension = | 358 scoped_refptr<extensions::Extension> extension = |
359 make_scoped_refptr(details.ptr()); | 359 make_scoped_refptr(details.ptr()); |
360 ASSERT_TRUE(extension.get()); | 360 ASSERT_TRUE(extension.get()); |
361 | 361 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 site_lists[0]->GetSites(&sites); | 414 site_lists[0]->GetSites(&sites); |
415 ASSERT_EQ(1u, sites.size()); | 415 ASSERT_EQ(1u, sites.size()); |
416 EXPECT_EQ(base::ASCIIToUTF16("Moose"), sites[0].name); | 416 EXPECT_EQ(base::ASCIIToUTF16("Moose"), sites[0].name); |
417 | 417 |
418 EXPECT_EQ(SupervisedUserURLFilter::WARN, | 418 EXPECT_EQ(SupervisedUserURLFilter::WARN, |
419 url_filter->GetFilteringBehaviorForURL(example_url)); | 419 url_filter->GetFilteringBehaviorForURL(example_url)); |
420 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, | 420 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, |
421 url_filter->GetFilteringBehaviorForURL(moose_url)); | 421 url_filter->GetFilteringBehaviorForURL(moose_url)); |
422 } | 422 } |
423 #endif // !defined(OS_ANDROID) | 423 #endif // !defined(OS_ANDROID) |
OLD | NEW |