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

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: Fix argument evaluation order bug. 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 uint32_t crc32c = ComputeCrc32c(this->some_data2);
137 Attachment attachment2 = Attachment::CreateFromParts( 137 Attachment attachment2 = Attachment::CreateFromParts(
138 attachment1.GetId(), this->some_data2, crc32c); 138 AttachmentId::Create(this->some_data2->size(), crc32c), this->some_data2);
pavely 2015/03/07 00:07:25 Restore the spirit. Discussed in person.
maniscalco 2015/03/09 17:09:00 Done.
139 139
140 // Write the first one. 140 // Write the first one.
141 AttachmentList some_attachments; 141 AttachmentList some_attachments;
142 some_attachments.push_back(attachment1); 142 some_attachments.push_back(attachment1);
143 this->store->Write(some_attachments, this->write_callback); 143 this->store->Write(some_attachments, this->write_callback);
144 this->ClearAndPumpLoop(); 144 this->ClearAndPumpLoop();
145 EXPECT_EQ(AttachmentStore::SUCCESS, this->result); 145 EXPECT_EQ(AttachmentStore::SUCCESS, this->result);
146 146
147 // Write the second one. 147 // Write the second one.
148 some_attachments.clear(); 148 some_attachments.clear();
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 Write_RoundTrip, 391 Write_RoundTrip,
392 Read_OneNotFound, 392 Read_OneNotFound,
393 Drop_DropTwoButOnlyOneExists, 393 Drop_DropTwoButOnlyOneExists,
394 Drop_DoesNotExist, 394 Drop_DoesNotExist,
395 ReadMetadata, 395 ReadMetadata,
396 ReadAllMetadata); 396 ReadAllMetadata);
397 397
398 } // namespace syncer 398 } // namespace syncer
399 399
400 #endif // SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ 400 #endif // SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698