Index: sync/api/attachments/attachment_service_proxy_unittest.cc |
diff --git a/sync/api/attachments/attachment_service_proxy_unittest.cc b/sync/api/attachments/attachment_service_proxy_unittest.cc |
index 08c499efecd64cb70c937d5e090220e4bba2cd30..f6e350228085460493dacbac6c9ff41d56f37a27 100644 |
--- a/sync/api/attachments/attachment_service_proxy_unittest.cc |
+++ b/sync/api/attachments/attachment_service_proxy_unittest.cc |
@@ -56,12 +56,9 @@ |
FROM_HERE, base::Bind(callback, AttachmentService::DROP_SUCCESS)); |
} |
- virtual void StoreAttachments(const AttachmentList& attachments, |
- const StoreCallback& callback) OVERRIDE { |
- CalledOnValidThread(); |
- Increment(); |
- base::MessageLoop::current()->PostTask( |
- FROM_HERE, base::Bind(callback, AttachmentService::STORE_SUCCESS)); |
+ virtual void OnSyncDataAdd(const SyncData& sync_data) OVERRIDE { |
+ CalledOnValidThread(); |
+ Increment(); |
} |
virtual void OnSyncDataDelete(const SyncData& sync_data) OVERRIDE { |
@@ -122,11 +119,8 @@ |
base::Unretained(this)); |
callback_drop = base::Bind(&AttachmentServiceProxyTest::IncrementDrop, |
base::Unretained(this)); |
- callback_store = base::Bind(&AttachmentServiceProxyTest::IncrementStore, |
- base::Unretained(this)); |
count_callback_get_or_download = 0; |
count_callback_drop = 0; |
- count_callback_store = 0; |
} |
virtual void TearDown() |
@@ -153,12 +147,6 @@ |
++count_callback_drop; |
} |
- // a StoreCallback |
- void IncrementStore(const AttachmentService::StoreResult&) { |
- CalledOnValidThread(); |
- ++count_callback_store; |
- } |
- |
void WaitForStubThread() { |
base::WaitableEvent done(false, false); |
stub_thread->message_loop()->PostTask( |
@@ -177,23 +165,21 @@ |
AttachmentService::GetOrDownloadCallback callback_get_or_download; |
AttachmentService::DropCallback callback_drop; |
- AttachmentService::StoreCallback callback_store; |
// number of times callback_get_or_download was invoked |
int count_callback_get_or_download; |
// number of times callback_drop was invoked |
int count_callback_drop; |
- // number of times callback_store was invoked |
- int count_callback_store; |
}; |
// Verify that each of AttachmentServiceProxy's regular methods (those that |
// don't take callbacks) are invoked on the stub. |
TEST_F(AttachmentServiceProxyTest, MethodsAreProxied) { |
+ proxy->OnSyncDataAdd(sync_data); |
proxy->OnSyncDataDelete(sync_data_delete); |
proxy->OnSyncDataUpdate(AttachmentIdList(), sync_data); |
WaitForStubThread(); |
- EXPECT_EQ(2, stub->GetCallCount()); |
+ EXPECT_EQ(3, stub->GetCallCount()); |
} |
// Verify that each of AttachmentServiceProxy's callback methods (those that |
@@ -202,10 +188,9 @@ |
TEST_F(AttachmentServiceProxyTest, MethodsWithCallbacksAreProxied) { |
proxy->GetOrDownloadAttachments(AttachmentIdList(), callback_get_or_download); |
proxy->DropAttachments(AttachmentIdList(), callback_drop); |
- proxy->StoreAttachments(AttachmentList(), callback_store); |
// Wait for the posted calls to execute in the stub thread. |
WaitForStubThread(); |
- EXPECT_EQ(3, stub->GetCallCount()); |
+ EXPECT_EQ(2, stub->GetCallCount()); |
// At this point the stub thread has finished executed the calls. However, the |
// result callbacks it has posted may not have executed yet. Wait a second |
// time to ensure the stub thread has executed the posted result callbacks. |
@@ -214,7 +199,6 @@ |
loop.RunUntilIdle(); |
EXPECT_EQ(1, count_callback_get_or_download); |
EXPECT_EQ(1, count_callback_drop); |
- EXPECT_EQ(1, count_callback_store); |
} |
// Verify that it's safe to use an AttachmentServiceProxy even after its wrapped |