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

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

Issue 270633005: Move code from sync/api/attachments to sync/internal_api/attachments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop some unneeded deps and trim DEPS. Created 6 years, 7 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/fake_attachment_uploader.cc ('k') | sync/internal_api/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/attachments/fake_attachment_uploader_unittest.cc
diff --git a/sync/api/attachments/fake_attachment_uploader_unittest.cc b/sync/api/attachments/fake_attachment_uploader_unittest.cc
deleted file mode 100644
index 09dccfc7b738be793d67d12c130399f022a91418..0000000000000000000000000000000000000000
--- a/sync/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/api/attachments/fake_attachment_uploader.h"
-
-#include "base/bind.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/ref_counted_memory.h"
-#include "base/message_loop/message_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:
- virtual void SetUp() {
- 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);
- message_loop.RunUntilIdle();
- EXPECT_EQ(upload_callback_count, 3);
-}
-
-} // namespace syncer
« no previous file with comments | « sync/api/attachments/fake_attachment_uploader.cc ('k') | sync/internal_api/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698