| 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" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 using extensions::Manifest; | 93 using extensions::Manifest; |
| 94 | 94 |
| 95 | 95 |
| 96 // ProfileResetterTest -------------------------------------------------------- | 96 // ProfileResetterTest -------------------------------------------------------- |
| 97 | 97 |
| 98 // ProfileResetterTest sets up the extension, WebData and TemplateURL services. | 98 // ProfileResetterTest sets up the extension, WebData and TemplateURL services. |
| 99 class ProfileResetterTest : public extensions::ExtensionServiceTestBase, | 99 class ProfileResetterTest : public extensions::ExtensionServiceTestBase, |
| 100 public ProfileResetterTestBase { | 100 public ProfileResetterTestBase { |
| 101 public: | 101 public: |
| 102 ProfileResetterTest(); | 102 ProfileResetterTest(); |
| 103 virtual ~ProfileResetterTest(); | 103 ~ProfileResetterTest() override; |
| 104 | 104 |
| 105 protected: | 105 protected: |
| 106 virtual void SetUp() override; | 106 void SetUp() override; |
| 107 | 107 |
| 108 TestingProfile* profile() { return profile_.get(); } | 108 TestingProfile* profile() { return profile_.get(); } |
| 109 | 109 |
| 110 static KeyedService* CreateTemplateURLService( | 110 static KeyedService* CreateTemplateURLService( |
| 111 content::BrowserContext* context); | 111 content::BrowserContext* context); |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
| 115 base::ScopedPathOverride user_desktop_override_; | 115 base::ScopedPathOverride user_desktop_override_; |
| 116 base::ScopedPathOverride app_dir_override_; | 116 base::ScopedPathOverride app_dir_override_; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 profile, Profile::EXPLICIT_ACCESS), | 154 profile, Profile::EXPLICIT_ACCESS), |
| 155 scoped_ptr<TemplateURLServiceClient>(), NULL, NULL, base::Closure()); | 155 scoped_ptr<TemplateURLServiceClient>(), NULL, NULL, base::Closure()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 | 158 |
| 159 // PinnedTabsResetTest -------------------------------------------------------- | 159 // PinnedTabsResetTest -------------------------------------------------------- |
| 160 | 160 |
| 161 class PinnedTabsResetTest : public BrowserWithTestWindowTest, | 161 class PinnedTabsResetTest : public BrowserWithTestWindowTest, |
| 162 public ProfileResetterTestBase { | 162 public ProfileResetterTestBase { |
| 163 protected: | 163 protected: |
| 164 virtual void SetUp() override; | 164 void SetUp() override; |
| 165 | 165 |
| 166 content::WebContents* CreateWebContents(); | 166 content::WebContents* CreateWebContents(); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 void PinnedTabsResetTest::SetUp() { | 169 void PinnedTabsResetTest::SetUp() { |
| 170 BrowserWithTestWindowTest::SetUp(); | 170 BrowserWithTestWindowTest::SetUp(); |
| 171 resetter_.reset(new ProfileResetter(profile())); | 171 resetter_.reset(new ProfileResetter(profile())); |
| 172 } | 172 } |
| 173 | 173 |
| 174 content::WebContents* PinnedTabsResetTest::CreateWebContents() { | 174 content::WebContents* PinnedTabsResetTest::CreateWebContents() { |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 new ResettableSettingsSnapshot(profile())); | 1096 new ResettableSettingsSnapshot(profile())); |
| 1097 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, | 1097 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, |
| 1098 base::Unretained(&capture))); | 1098 base::Unretained(&capture))); |
| 1099 deleted_snapshot.reset(); | 1099 deleted_snapshot.reset(); |
| 1100 // 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 |
| 1101 // |deleted_snapshot| was deleted before it could run. | 1101 // |deleted_snapshot| was deleted before it could run. |
| 1102 base::MessageLoop::current()->RunUntilIdle(); | 1102 base::MessageLoop::current()->RunUntilIdle(); |
| 1103 } | 1103 } |
| 1104 | 1104 |
| 1105 } // namespace | 1105 } // namespace |
| OLD | NEW |