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

Unified Diff: content/public/test/mock_blob_url_request_context.cc

Issue 2368913003: Populate storage_unittests target. (Closed)
Patch Set: Removed unnecessary include from storage/browser/blob/blob_storage_context_unittest.cc. Created 4 years, 3 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: content/public/test/mock_blob_url_request_context.cc
diff --git a/content/public/test/mock_blob_url_request_context.cc b/content/public/test/mock_blob_url_request_context.cc
deleted file mode 100644
index 515c1f3c280706b734d3e6663a9b5babb5c59a9f..0000000000000000000000000000000000000000
--- a/content/public/test/mock_blob_url_request_context.cc
+++ /dev/null
@@ -1,51 +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 "content/public/test/mock_blob_url_request_context.h"
-
-#include "base/memory/ptr_util.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "storage/browser/blob/blob_data_builder.h"
-#include "storage/browser/blob/blob_storage_context.h"
-#include "storage/browser/blob/blob_url_request_job.h"
-#include "storage/browser/blob/blob_url_request_job_factory.h"
-
-namespace content {
-
-MockBlobURLRequestContext::MockBlobURLRequestContext(
- storage::FileSystemContext* file_system_context)
- : blob_storage_context_(new storage::BlobStorageContext) {
- // Job factory owns the protocol handler.
- job_factory_.SetProtocolHandler(
- "blob", base::MakeUnique<storage::BlobProtocolHandler>(
- blob_storage_context_.get(), file_system_context,
- base::ThreadTaskRunnerHandle::Get()));
- set_job_factory(&job_factory_);
-}
-
-MockBlobURLRequestContext::~MockBlobURLRequestContext() {
- AssertNoURLRequests();
-}
-
-ScopedTextBlob::ScopedTextBlob(
- const MockBlobURLRequestContext& request_context,
- const std::string& blob_id,
- const std::string& data)
- : blob_id_(blob_id),
- context_(request_context.blob_storage_context()) {
- DCHECK(context_);
- storage::BlobDataBuilder blob_builder(blob_id_);
- if (!data.empty())
- blob_builder.AppendData(data);
- handle_ = context_->AddFinishedBlob(&blob_builder);
-}
-
-ScopedTextBlob::~ScopedTextBlob() {
-}
-
-std::unique_ptr<storage::BlobDataHandle> ScopedTextBlob::GetBlobDataHandle() {
- return context_->GetBlobDataFromUUID(blob_id_);
-}
-
-} // namespace content
« no previous file with comments | « content/public/test/mock_blob_url_request_context.h ('k') | content/public/test/mock_special_storage_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698