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

Unified Diff: chrome/browser/sync/profile_sync_service_unittest.cc

Issue 16207005: Fix remaining uses of WeakPtr<T>'s operator T* conversion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc
index 00afd978c35723b362cb0a1bf2f70624305edfcb..d8489a3294886ef744bdb04d429b342917dca385 100644
--- a/chrome/browser/sync/profile_sync_service_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc
@@ -321,7 +321,8 @@ TEST_F(ProfileSyncServiceTest, JsControllerHandlersBasic) {
EXPECT_TRUE(harness_.service->sync_initialized());
EXPECT_TRUE(harness_.service->GetBackendForTest() != NULL);
- syncer::JsController* js_controller = harness_.service->GetJsController();
+ base::WeakPtr<syncer::JsController> js_controller =
+ harness_.service->GetJsController();
StrictMock<syncer::MockJsEventHandler> event_handler;
js_controller->AddJsEventHandler(&event_handler);
js_controller->RemoveJsEventHandler(&event_handler);
@@ -338,7 +339,8 @@ TEST_F(ProfileSyncServiceTest,
EXPECT_EQ(NULL, harness_.service->GetBackendForTest());
EXPECT_FALSE(harness_.service->sync_initialized());
- syncer::JsController* js_controller = harness_.service->GetJsController();
+ base::WeakPtr<syncer::JsController> js_controller =
+ harness_.service->GetJsController();
js_controller->AddJsEventHandler(&event_handler);
// Since we're doing synchronous initialization, backend should be
// initialized by this call.
@@ -359,7 +361,8 @@ TEST_F(ProfileSyncServiceTest, JsControllerProcessJsMessageBasic) {
HandleJsReply("getNotificationState", HasArgs(args1)));
{
- syncer::JsController* js_controller = harness_.service->GetJsController();
+ base::WeakPtr<syncer::JsController> js_controller =
+ harness_.service->GetJsController();
js_controller->ProcessJsMessage("getNotificationState", args1,
reply_handler.AsWeakHandle());
}
@@ -382,7 +385,8 @@ TEST_F(ProfileSyncServiceTest,
HandleJsReply("getNotificationState", HasArgs(args1)));
{
- syncer::JsController* js_controller = harness_.service->GetJsController();
+ base::WeakPtr<syncer::JsController> js_controller =
+ harness_.service->GetJsController();
js_controller->ProcessJsMessage("getNotificationState",
args1, reply_handler.AsWeakHandle());
}
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_service.cc ('k') | chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698