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

Unified Diff: sync/internal_api/attachments/fake_attachment_uploader_unittest.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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: sync/internal_api/attachments/fake_attachment_uploader_unittest.cc
diff --git a/sync/internal_api/attachments/fake_attachment_uploader_unittest.cc b/sync/internal_api/attachments/fake_attachment_uploader_unittest.cc
deleted file mode 100644
index 5d86ad483b08299eb480443b64d7d52b14a96f61..0000000000000000000000000000000000000000
--- a/sync/internal_api/attachments/fake_attachment_uploader_unittest.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/internal_api/public/attachments/fake_attachment_uploader.h"
-
-#include "base/bind.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/ref_counted_memory.h"
-#include "base/run_loop.h"
-#include "sync/api/attachments/attachment.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer {
-
-namespace {
-
-const char kAttachmentData[] = "some data";
-
-} // namespace
-
-class FakeAttachmentUploaderTest : public testing::Test {
- protected:
- void SetUp() override {
- upload_callback_count = 0;
- upload_callback = base::Bind(&FakeAttachmentUploaderTest::Increment,
- base::Unretained(this),
- &upload_callback_count);
- }
- base::MessageLoop message_loop;
- FakeAttachmentUploader uploader;
- int upload_callback_count;
- AttachmentUploader::UploadCallback upload_callback;
-
- private:
- void Increment(int* success_count,
- const AttachmentUploader::UploadResult& result,
- const AttachmentId& ignored) {
- if (result == AttachmentUploader::UPLOAD_SUCCESS) {
- ++(*success_count);
- }
- }
-};
-
-// Call upload attachment several times, see that the supplied callback is
-// invoked the same number of times with a result of SUCCESS.
-TEST_F(FakeAttachmentUploaderTest, UploadAttachment) {
- scoped_refptr<base::RefCountedString> some_data(new base::RefCountedString);
- some_data->data() = kAttachmentData;
- Attachment attachment1 = Attachment::Create(some_data);
- Attachment attachment2 = Attachment::Create(some_data);
- Attachment attachment3 = Attachment::Create(some_data);
- uploader.UploadAttachment(attachment1, upload_callback);
- uploader.UploadAttachment(attachment2, upload_callback);
- uploader.UploadAttachment(attachment3, upload_callback);
- base::RunLoop().RunUntilIdle();
- EXPECT_EQ(upload_callback_count, 3);
-}
-
-} // namespace syncer
« no previous file with comments | « sync/internal_api/attachments/fake_attachment_uploader.cc ('k') | sync/internal_api/attachments/in_memory_attachment_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698