| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 profile()->CreateWebDataService(); | 138 profile()->CreateWebDataService(); |
| 139 TemplateURLServiceFactory::GetInstance()->SetTestingFactory( | 139 TemplateURLServiceFactory::GetInstance()->SetTestingFactory( |
| 140 profile(), | 140 profile(), |
| 141 &ProfileResetterTest::CreateTemplateURLService); | 141 &ProfileResetterTest::CreateTemplateURLService); |
| 142 resetter_.reset(new ProfileResetter(profile())); | 142 resetter_.reset(new ProfileResetter(profile())); |
| 143 } | 143 } |
| 144 | 144 |
| 145 // static | 145 // static |
| 146 KeyedService* ProfileResetterTest::CreateTemplateURLService( | 146 KeyedService* ProfileResetterTest::CreateTemplateURLService( |
| 147 content::BrowserContext* context) { | 147 content::BrowserContext* context) { |
| 148 return new TemplateURLService(static_cast<Profile*>(context), NULL); | 148 return new TemplateURLService(static_cast<Profile*>(context), NULL, |
| 149 base::Closure()); |
| 149 } | 150 } |
| 150 | 151 |
| 151 | 152 |
| 152 // PinnedTabsResetTest -------------------------------------------------------- | 153 // PinnedTabsResetTest -------------------------------------------------------- |
| 153 | 154 |
| 154 class PinnedTabsResetTest : public BrowserWithTestWindowTest, | 155 class PinnedTabsResetTest : public BrowserWithTestWindowTest, |
| 155 public ProfileResetterTestBase { | 156 public ProfileResetterTestBase { |
| 156 protected: | 157 protected: |
| 157 virtual void SetUp() OVERRIDE; | 158 virtual void SetUp() OVERRIDE; |
| 158 | 159 |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 new ResettableSettingsSnapshot(profile())); | 1097 new ResettableSettingsSnapshot(profile())); |
| 1097 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, | 1098 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, |
| 1098 base::Unretained(&capture))); | 1099 base::Unretained(&capture))); |
| 1099 deleted_snapshot.reset(); | 1100 deleted_snapshot.reset(); |
| 1100 // Running remaining tasks shouldn't trigger the callback to be called as | 1101 // Running remaining tasks shouldn't trigger the callback to be called as |
| 1101 // |deleted_snapshot| was deleted before it could run. | 1102 // |deleted_snapshot| was deleted before it could run. |
| 1102 base::MessageLoop::current()->RunUntilIdle(); | 1103 base::MessageLoop::current()->RunUntilIdle(); |
| 1103 } | 1104 } |
| 1104 | 1105 |
| 1105 } // namespace | 1106 } // namespace |
| OLD | NEW |