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

Unified Diff: sync/api/attachments/attachment_service_proxy_unittest.cc

Issue 265853004: Revert of Keep track of which attachments are referenced by which sync entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « sync/api/attachments/attachment_service_proxy.cc ('k') | sync/api/attachments/fake_attachment_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « sync/api/attachments/attachment_service_proxy.cc ('k') | sync/api/attachments/fake_attachment_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698