| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/fileapi/fileapi_message_filter.h" | 5 #include "content/browser/fileapi/fileapi_message_filter.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 TEST_F(FileAPIMessageFilterTest, BuildNonEmptyStream) { | 190 TEST_F(FileAPIMessageFilterTest, BuildNonEmptyStream) { |
| 191 StreamRegistry* stream_registry = stream_context_->registry(); | 191 StreamRegistry* stream_registry = stream_context_->registry(); |
| 192 | 192 |
| 193 const GURL kUrl(kFakeBlobInternalUrlSpec); | 193 const GURL kUrl(kFakeBlobInternalUrlSpec); |
| 194 | 194 |
| 195 EXPECT_EQ(NULL, stream_registry->GetStream(kUrl).get()); | 195 EXPECT_EQ(NULL, stream_registry->GetStream(kUrl).get()); |
| 196 | 196 |
| 197 StreamHostMsg_StartBuilding start_message(kUrl, kFakeContentType); | 197 StreamHostMsg_StartBuilding start_message(kUrl, kFakeContentType); |
| 198 EXPECT_TRUE(filter_->OnMessageReceived(start_message)); | 198 EXPECT_TRUE(filter_->OnMessageReceived(start_message)); |
| 199 | 199 |
| 200 storage::BlobData::Item item; | 200 storage::DataElement item; |
| 201 const std::string kFakeData = "foobarbaz"; | 201 const std::string kFakeData = "foobarbaz"; |
| 202 item.SetToBytes(kFakeData.data(), kFakeData.size()); | 202 item.SetToBytes(kFakeData.data(), kFakeData.size()); |
| 203 StreamHostMsg_AppendBlobDataItem append_message(kUrl, item); | 203 StreamHostMsg_AppendBlobDataItem append_message(kUrl, item); |
| 204 EXPECT_TRUE(filter_->OnMessageReceived(append_message)); | 204 EXPECT_TRUE(filter_->OnMessageReceived(append_message)); |
| 205 | 205 |
| 206 StreamHostMsg_FinishBuilding finish_message(kUrl); | 206 StreamHostMsg_FinishBuilding finish_message(kUrl); |
| 207 EXPECT_TRUE(filter_->OnMessageReceived(finish_message)); | 207 EXPECT_TRUE(filter_->OnMessageReceived(finish_message)); |
| 208 | 208 |
| 209 // Run loop to finish transfer and commit finalize command. | 209 // Run loop to finish transfer and commit finalize command. |
| 210 message_loop_.RunUntilIdle(); | 210 message_loop_.RunUntilIdle(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 EXPECT_TRUE(filter_->OnMessageReceived(start_message)); | 297 EXPECT_TRUE(filter_->OnMessageReceived(start_message)); |
| 298 | 298 |
| 299 StreamHostMsg_Clone clone_message(kDestUrl, kUrl); | 299 StreamHostMsg_Clone clone_message(kDestUrl, kUrl); |
| 300 EXPECT_TRUE(filter_->OnMessageReceived(clone_message)); | 300 EXPECT_TRUE(filter_->OnMessageReceived(clone_message)); |
| 301 | 301 |
| 302 ASSERT_FALSE(stream_registry->GetStream(kUrl).get() == NULL); | 302 ASSERT_FALSE(stream_registry->GetStream(kUrl).get() == NULL); |
| 303 ASSERT_FALSE(stream_registry->GetStream(kDestUrl).get() == NULL); | 303 ASSERT_FALSE(stream_registry->GetStream(kDestUrl).get() == NULL); |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace content | 306 } // namespace content |
| OLD | NEW |