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

Side by Side Diff: sync/internal_api/attachments/attachment_store_test_template.h

Issue 982883002: [Sync] Add size and crc32c to AttachmentId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 5 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ 5 #ifndef SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_
6 #define SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ 6 #define SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_
7 7
8 #include "sync/api/attachments/attachment_store.h" 8 #include "sync/api/attachments/attachment_store.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 126 }
127 }; 127 };
128 128
129 TYPED_TEST_CASE_P(AttachmentStoreTest); 129 TYPED_TEST_CASE_P(AttachmentStoreTest);
130 130
131 // Verify that we do not overwrite existing attachments and that we do not treat 131 // Verify that we do not overwrite existing attachments and that we do not treat
132 // it as an error. 132 // it as an error.
133 TYPED_TEST_P(AttachmentStoreTest, Write_NoOverwriteNoError) { 133 TYPED_TEST_P(AttachmentStoreTest, Write_NoOverwriteNoError) {
134 // Create two attachments with the same id but different data. 134 // Create two attachments with the same id but different data.
135 Attachment attachment1 = Attachment::Create(this->some_data1); 135 Attachment attachment1 = Attachment::Create(this->some_data1);
136 uint32_t crc32c = ComputeCrc32c(this->some_data2); 136 Attachment attachment2 =
137 Attachment attachment2 = Attachment::CreateFromParts( 137 Attachment::CreateFromParts(attachment1.GetId(), this->some_data2);
138 attachment1.GetId(), this->some_data2, crc32c);
139 138
140 // Write the first one. 139 // Write the first one.
141 AttachmentList some_attachments; 140 AttachmentList some_attachments;
142 some_attachments.push_back(attachment1); 141 some_attachments.push_back(attachment1);
143 this->store->Write(some_attachments, this->write_callback); 142 this->store->Write(some_attachments, this->write_callback);
144 this->ClearAndPumpLoop(); 143 this->ClearAndPumpLoop();
145 EXPECT_EQ(AttachmentStore::SUCCESS, this->result); 144 EXPECT_EQ(AttachmentStore::SUCCESS, this->result);
146 145
147 // Write the second one. 146 // Write the second one.
148 some_attachments.clear(); 147 some_attachments.clear();
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 Write_RoundTrip, 390 Write_RoundTrip,
392 Read_OneNotFound, 391 Read_OneNotFound,
393 Drop_DropTwoButOnlyOneExists, 392 Drop_DropTwoButOnlyOneExists,
394 Drop_DoesNotExist, 393 Drop_DoesNotExist,
395 ReadMetadata, 394 ReadMetadata,
396 ReadAllMetadata); 395 ReadAllMetadata);
397 396
398 } // namespace syncer 397 } // namespace syncer
399 398
400 #endif // SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ 399 #endif // SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698