OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "storage/browser/blob/blob_storage_context.h" | 5 #include "storage/browser/blob/blob_storage_context.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <memory> | 10 #include <memory> |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 EXPECT_EQ(0lu, context_->memory_controller().disk_usage()); | 583 EXPECT_EQ(0lu, context_->memory_controller().disk_usage()); |
584 } | 584 } |
585 | 585 |
586 TEST_F(BlobStorageContextTest, CompoundBlobs) { | 586 TEST_F(BlobStorageContextTest, CompoundBlobs) { |
587 const std::string kId1("id1"); | 587 const std::string kId1("id1"); |
588 const std::string kId2("id2"); | 588 const std::string kId2("id2"); |
589 const std::string kId3("id3"); | 589 const std::string kId3("id3"); |
590 | 590 |
591 // Setup a set of blob data for testing. | 591 // Setup a set of blob data for testing. |
592 base::Time time1, time2; | 592 base::Time time1, time2; |
593 base::Time::FromString("Tue, 15 Nov 1994, 12:45:26 GMT", &time1); | 593 ASSERT_TRUE(base::Time::FromString("Tue, 15 Nov 1994, 12:45:26 GMT", &time1)); |
594 base::Time::FromString("Mon, 14 Nov 1994, 11:30:49 GMT", &time2); | 594 ASSERT_TRUE(base::Time::FromString("Mon, 14 Nov 1994, 11:30:49 GMT", &time2)); |
595 | 595 |
596 BlobDataBuilder blob_data1(kId1); | 596 BlobDataBuilder blob_data1(kId1); |
597 blob_data1.AppendData("Data1"); | 597 blob_data1.AppendData("Data1"); |
598 blob_data1.AppendData("Data2"); | 598 blob_data1.AppendData("Data2"); |
599 blob_data1.AppendFile(base::FilePath(FILE_PATH_LITERAL("File1.txt")), 10, | 599 blob_data1.AppendFile(base::FilePath(FILE_PATH_LITERAL("File1.txt")), 10, |
600 1024, time1); | 600 1024, time1); |
601 | 601 |
602 BlobDataBuilder blob_data2(kId2); | 602 BlobDataBuilder blob_data2(kId2); |
603 blob_data2.AppendData("Data3"); | 603 blob_data2.AppendData("Data3"); |
604 blob_data2.AppendBlob(kId1, 8, 100); | 604 blob_data2.AppendBlob(kId1, 8, 100); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 EXPECT_TRUE(file_runner_->HasPendingTask()); | 888 EXPECT_TRUE(file_runner_->HasPendingTask()); |
889 file_runner_->RunPendingTasks(); | 889 file_runner_->RunPendingTasks(); |
890 base::RunLoop().RunUntilIdle(); | 890 base::RunLoop().RunUntilIdle(); |
891 EXPECT_EQ(0lu, context_->memory_controller().memory_usage()); | 891 EXPECT_EQ(0lu, context_->memory_controller().memory_usage()); |
892 EXPECT_EQ(0lu, context_->memory_controller().disk_usage()); | 892 EXPECT_EQ(0lu, context_->memory_controller().disk_usage()); |
893 } | 893 } |
894 | 894 |
895 // TODO(michaeln): tests for the deprecated url stuff | 895 // TODO(michaeln): tests for the deprecated url stuff |
896 | 896 |
897 } // namespace storage | 897 } // namespace storage |
OLD | NEW |