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

Side by Side Diff: chrome/browser/media/router/media_router_mojo_impl_unittest.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // handling. 76 // handling.
77 class TestProcessManager : public extensions::ProcessManager { 77 class TestProcessManager : public extensions::ProcessManager {
78 public: 78 public:
79 explicit TestProcessManager(content::BrowserContext* context) 79 explicit TestProcessManager(content::BrowserContext* context)
80 : extensions::ProcessManager( 80 : extensions::ProcessManager(
81 context, 81 context,
82 context, 82 context,
83 extensions::ExtensionRegistry::Get(context)) {} 83 extensions::ExtensionRegistry::Get(context)) {}
84 ~TestProcessManager() override {} 84 ~TestProcessManager() override {}
85 85
86 static KeyedService* Create(content::BrowserContext* context) { 86 static scoped_ptr<KeyedService> Create(content::BrowserContext* context) {
87 return new TestProcessManager(context); 87 return make_scoped_ptr(new TestProcessManager(context));
88 } 88 }
89 89
90 MOCK_METHOD1(IsEventPageSuspended, bool(const std::string& ext_id)); 90 MOCK_METHOD1(IsEventPageSuspended, bool(const std::string& ext_id));
91 91
92 MOCK_METHOD2(WakeEventPage, 92 MOCK_METHOD2(WakeEventPage,
93 bool(const std::string& extension_id, 93 bool(const std::string& extension_id,
94 const base::Callback<void(bool)>& callback)); 94 const base::Callback<void(bool)>& callback));
95 95
96 private: 96 private:
97 DISALLOW_COPY_AND_ASSIGN(TestProcessManager); 97 DISALLOW_COPY_AND_ASSIGN(TestProcessManager);
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 CloseRoute(mojo::String(kRouteId2))); 371 CloseRoute(mojo::String(kRouteId2)));
372 binding.reset(new mojo::Binding<interfaces::MediaRouter>( 372 binding.reset(new mojo::Binding<interfaces::MediaRouter>(
373 &mock_mojo_media_router_service, mojo::GetProxy(&mojo_media_router))); 373 &mock_mojo_media_router_service, mojo::GetProxy(&mojo_media_router)));
374 mojo_media_router_observer->ProvideMediaRouter( 374 mojo_media_router_observer->ProvideMediaRouter(
375 mojo_media_router.Pass(), base::Bind(&ProvideMediaRouterHandler::Invoke, 375 mojo_media_router.Pass(), base::Bind(&ProvideMediaRouterHandler::Invoke,
376 base::Unretained(&provide_handler))); 376 base::Unretained(&provide_handler)));
377 message_loop.RunUntilIdle(); 377 message_loop.RunUntilIdle();
378 } 378 }
379 379
380 } // namespace media_router 380 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698