| 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 "chrome/browser/profile_resetter/profile_resetter.h" | 5 #include "chrome/browser/profile_resetter/profile_resetter.h" |
| 6 | 6 |
| 7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/test/scoped_path_override.h" | 10 #include "base/test/scoped_path_override.h" |
| 11 #include "chrome/browser/content_settings/host_content_settings_map.h" | 11 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 12 #include "chrome/browser/extensions/extension_service_unittest.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/extensions/extension_service_test_base.h" |
| 13 #include "chrome/browser/extensions/tab_helper.h" | 14 #include "chrome/browser/extensions/tab_helper.h" |
| 14 #include "chrome/browser/notifications/desktop_notification_service.h" | 15 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 15 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 16 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 16 #include "chrome/browser/prefs/session_startup_pref.h" | 17 #include "chrome/browser/prefs/session_startup_pref.h" |
| 17 #include "chrome/browser/profile_resetter/brandcode_config_fetcher.h" | 18 #include "chrome/browser/profile_resetter/brandcode_config_fetcher.h" |
| 18 #include "chrome/browser/profile_resetter/profile_resetter_test_base.h" | 19 #include "chrome/browser/profile_resetter/profile_resetter_test_base.h" |
| 19 #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" | 20 #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" |
| 20 #include "chrome/browser/search_engines/template_url_service.h" | 21 #include "chrome/browser/search_engines/template_url_service.h" |
| 21 #include "chrome/browser/search_engines/template_url_service_factory.h" | 22 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 22 #include "chrome/browser/themes/theme_service.h" | 23 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 "</app>" | 88 "</app>" |
| 88 "</response>"; | 89 "</response>"; |
| 89 | 90 |
| 90 using extensions::Extension; | 91 using extensions::Extension; |
| 91 using extensions::Manifest; | 92 using extensions::Manifest; |
| 92 | 93 |
| 93 | 94 |
| 94 // ProfileResetterTest -------------------------------------------------------- | 95 // ProfileResetterTest -------------------------------------------------------- |
| 95 | 96 |
| 96 // ProfileResetterTest sets up the extension, WebData and TemplateURL services. | 97 // ProfileResetterTest sets up the extension, WebData and TemplateURL services. |
| 97 class ProfileResetterTest : public ExtensionServiceTestBase, | 98 class ProfileResetterTest : public extensions::ExtensionServiceTestBase, |
| 98 public ProfileResetterTestBase { | 99 public ProfileResetterTestBase { |
| 99 public: | 100 public: |
| 100 ProfileResetterTest(); | 101 ProfileResetterTest(); |
| 101 virtual ~ProfileResetterTest(); | 102 virtual ~ProfileResetterTest(); |
| 102 | 103 |
| 103 protected: | 104 protected: |
| 104 virtual void SetUp() OVERRIDE; | 105 virtual void SetUp() OVERRIDE; |
| 105 | 106 |
| 106 TestingProfile* profile() { return profile_.get(); } | 107 TestingProfile* profile() { return profile_.get(); } |
| 107 | 108 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 124 app_dir_override_(base::DIR_APP_DATA), | 125 app_dir_override_(base::DIR_APP_DATA), |
| 125 start_menu_override_(base::DIR_START_MENU), | 126 start_menu_override_(base::DIR_START_MENU), |
| 126 taskbar_pins_override_(base::DIR_TASKBAR_PINS) | 127 taskbar_pins_override_(base::DIR_TASKBAR_PINS) |
| 127 #endif | 128 #endif |
| 128 {} | 129 {} |
| 129 | 130 |
| 130 ProfileResetterTest::~ProfileResetterTest() { | 131 ProfileResetterTest::~ProfileResetterTest() { |
| 131 } | 132 } |
| 132 | 133 |
| 133 void ProfileResetterTest::SetUp() { | 134 void ProfileResetterTest::SetUp() { |
| 134 ExtensionServiceTestBase::SetUp(); | 135 extensions::ExtensionServiceTestBase::SetUp(); |
| 135 InitializeEmptyExtensionService(); | 136 InitializeEmptyExtensionService(); |
| 136 | 137 |
| 137 profile()->CreateWebDataService(); | 138 profile()->CreateWebDataService(); |
| 138 TemplateURLServiceFactory::GetInstance()->SetTestingFactory( | 139 TemplateURLServiceFactory::GetInstance()->SetTestingFactory( |
| 139 profile(), | 140 profile(), |
| 140 &ProfileResetterTest::CreateTemplateURLService); | 141 &ProfileResetterTest::CreateTemplateURLService); |
| 141 resetter_.reset(new ProfileResetter(profile())); | 142 resetter_.reset(new ProfileResetter(profile())); |
| 142 } | 143 } |
| 143 | 144 |
| 144 // static | 145 // static |
| (...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 new ResettableSettingsSnapshot(profile())); | 1096 new ResettableSettingsSnapshot(profile())); |
| 1096 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, | 1097 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, |
| 1097 base::Unretained(&capture))); | 1098 base::Unretained(&capture))); |
| 1098 deleted_snapshot.reset(); | 1099 deleted_snapshot.reset(); |
| 1099 // Running remaining tasks shouldn't trigger the callback to be called as | 1100 // Running remaining tasks shouldn't trigger the callback to be called as |
| 1100 // |deleted_snapshot| was deleted before it could run. | 1101 // |deleted_snapshot| was deleted before it could run. |
| 1101 base::MessageLoop::current()->RunUntilIdle(); | 1102 base::MessageLoop::current()->RunUntilIdle(); |
| 1102 } | 1103 } |
| 1103 | 1104 |
| 1104 } // namespace | 1105 } // namespace |
| OLD | NEW |