Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: chrome/browser/extensions/api/idle/idle_api_unittest.cc

Issue 826933003: Update idle extension API to use BrowserContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make BrowserContext members const Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/idle/idle_api_unittest.cc
diff --git a/chrome/browser/extensions/api/idle/idle_api_unittest.cc b/chrome/browser/extensions/api/idle/idle_api_unittest.cc
index c3ced42f6bcc4bf4e5b0d144a68e5f815e48b410..b62a88090659f706759889177c50459b07610431 100644
--- a/chrome/browser/extensions/api/idle/idle_api_unittest.cc
+++ b/chrome/browser/extensions/api/idle/idle_api_unittest.cc
@@ -117,12 +117,16 @@ ScopedListen::~ScopedListen() {
idle_manager_->OnListenerRemoved(details);
}
-KeyedService* IdleManagerTestFactory(content::BrowserContext* profile) {
- return new IdleManager(static_cast<Profile*>(profile));
+KeyedService* IdleManagerTestFactory(content::BrowserContext* context) {
+ return new IdleManager(context);
}
} // namespace
+// TODO(derat): Make this instead derive from extensions::ApiUnitTest after
+// moving it out of the unit_tests target. Its base class can't be changed
+// before then since doing so results in crashes due to multiple
+// content::NotificationService instances being created.
class IdleTest : public ExtensionApiUnittest {
public:
void SetUp() override;
@@ -138,7 +142,8 @@ void IdleTest::SetUp() {
IdleManagerFactory::GetInstance()->SetTestingFactory(browser()->profile(),
&IdleManagerTestFactory);
- idle_manager_ = IdleManagerFactory::GetForProfile(browser()->profile());
+ idle_manager_ = IdleManagerFactory::GetForBrowserContext(
+ browser()->profile());
idle_provider_ = new TestIdleProvider();
idle_manager_->SetIdleTimeProviderForTest(

Powered by Google App Engine
This is Rietveld 408576698