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

Unified Diff: content/browser/fileapi/fileapi_message_filter_unittest.cc

Issue 23223003: Chromium Blob hacking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/browser/fileapi/fileapi_message_filter_unittest.cc
diff --git a/content/browser/fileapi/fileapi_message_filter_unittest.cc b/content/browser/fileapi/fileapi_message_filter_unittest.cc
index 06b112ba64ddbfe2d23167638c941a4b7dc619f8..90e422c7da6f8a8f553f523399fc08861a3df939 100644
--- a/content/browser/fileapi/fileapi_message_filter_unittest.cc
+++ b/content/browser/fileapi/fileapi_message_filter_unittest.cc
@@ -23,7 +23,7 @@
#include "content/public/test/test_browser_thread.h"
#include "net/base/io_buffer.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/browser/blob/blob_storage_controller.h"
+#include "webkit/browser/blob/blob_storage_context.h"
#include "webkit/browser/fileapi/file_system_context.h"
#include "webkit/browser/fileapi/mock_file_system_context.h"
#include "webkit/common/blob/blob_data.h"
@@ -95,34 +95,6 @@ class FileAPIMessageFilterTest : public testing::Test {
scoped_refptr<FileAPIMessageFilter> filter_;
};
-TEST_F(FileAPIMessageFilterTest, BuildEmptyBlob) {
- webkit_blob::BlobStorageController* controller =
- blob_storage_context_->controller();
-
- const GURL kUrl("blob:foobar");
- const GURL kDifferentUrl("blob:barfoo");
-
- EXPECT_EQ(NULL, controller->GetBlobDataFromUrl(kUrl));
-
- BlobHostMsg_StartBuilding start_message(kUrl);
- EXPECT_TRUE(InvokeOnMessageReceived(start_message));
-
- // Blob is still being built. Nothing should be returned.
- EXPECT_EQ(NULL, controller->GetBlobDataFromUrl(kUrl));
-
- BlobHostMsg_FinishBuilding finish_message(kUrl, kFakeContentType);
- EXPECT_TRUE(InvokeOnMessageReceived(finish_message));
-
- // Now, Blob is built.
- webkit_blob::BlobData* blob_data = controller->GetBlobDataFromUrl(kUrl);
- ASSERT_FALSE(blob_data == NULL);
- EXPECT_EQ(0U, blob_data->items().size());
- EXPECT_EQ(kFakeContentType, blob_data->content_type());
-
- // Nothing should be returned for a URL we didn't use.
- EXPECT_TRUE(controller->GetBlobDataFromUrl(kDifferentUrl) == NULL);
-}
-
TEST_F(FileAPIMessageFilterTest, CloseChannelWithInflightRequest) {
scoped_refptr<FileAPIMessageFilter> filter(
new FileAPIMessageFilter(
@@ -190,14 +162,10 @@ TEST_F(FileAPIMessageFilterTest, MultipleFilters) {
TEST_F(FileAPIMessageFilterTest, BuildEmptyStream) {
StreamRegistry* stream_registry = stream_context_->registry();
- webkit_blob::BlobStorageController* blob_controller =
- blob_storage_context_->controller();
-
const GURL kUrl(kFakeBlobInternalUrlSpec);
const GURL kDifferentUrl("blob:barfoo");
EXPECT_EQ(NULL, stream_registry->GetStream(kUrl).get());
- EXPECT_EQ(NULL, blob_controller->GetBlobDataFromUrl(kUrl));
StreamHostMsg_StartBuilding start_message(kUrl, kFakeContentType);
EXPECT_TRUE(InvokeOnMessageReceived(start_message));
@@ -217,9 +185,6 @@ TEST_F(FileAPIMessageFilterTest, BuildEmptyStream) {
StreamHostMsg_FinishBuilding finish_message(kUrl);
EXPECT_TRUE(InvokeOnMessageReceived(finish_message));
- // Blob controller shouldn't be affected.
- EXPECT_EQ(NULL, blob_controller->GetBlobDataFromUrl(kUrl));
-
stream = stream_registry->GetStream(kUrl);
ASSERT_FALSE(stream.get() == NULL);
EXPECT_EQ(Stream::STREAM_EMPTY,
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698