| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 11 #include "base/scoped_temp_dir.h" | |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
| 14 #include "net/url_request/url_request.h" | 14 #include "net/url_request/url_request.h" |
| 15 #include "net/url_request/url_request_context.h" | 15 #include "net/url_request/url_request_context.h" |
| 16 #include "net/url_request/url_request_job.h" | 16 #include "net/url_request/url_request_job.h" |
| 17 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
| 18 #include "testing/platform_test.h" | 18 #include "testing/platform_test.h" |
| 19 #include "webkit/fileapi/file_system_context.h" | 19 #include "webkit/fileapi/file_system_context.h" |
| 20 #include "webkit/fileapi/file_writer_delegate.h" | 20 #include "webkit/fileapi/file_writer_delegate.h" |
| 21 #include "webkit/fileapi/local_file_system_operation.h" | 21 #include "webkit/fileapi/local_file_system_operation.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 // This should be alive until the very end of this instance. | 122 // This should be alive until the very end of this instance. |
| 123 MessageLoop loop_; | 123 MessageLoop loop_; |
| 124 | 124 |
| 125 net::URLRequestContext empty_context_; | 125 net::URLRequestContext empty_context_; |
| 126 scoped_ptr<FileWriterDelegate> file_writer_delegate_; | 126 scoped_ptr<FileWriterDelegate> file_writer_delegate_; |
| 127 scoped_ptr<net::URLRequest> request_; | 127 scoped_ptr<net::URLRequest> request_; |
| 128 scoped_ptr<Result> result_; | 128 scoped_ptr<Result> result_; |
| 129 LocalFileSystemTestOriginHelper test_helper_; | 129 LocalFileSystemTestOriginHelper test_helper_; |
| 130 | 130 |
| 131 ScopedTempDir dir_; | 131 base::ScopedTempDir dir_; |
| 132 | 132 |
| 133 static const char* content_; | 133 static const char* content_; |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 const char* FileWriterDelegateTest::content_ = NULL; | 136 const char* FileWriterDelegateTest::content_ = NULL; |
| 137 | 137 |
| 138 namespace { | 138 namespace { |
| 139 | 139 |
| 140 static std::string g_content; | 140 static std::string g_content; |
| 141 | 141 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 file_writer_delegate_.reset(); | 458 file_writer_delegate_.reset(); |
| 459 | 459 |
| 460 EXPECT_EQ(pre_write_usage + allowed_growth, | 460 EXPECT_EQ(pre_write_usage + allowed_growth, |
| 461 test_helper_.GetCachedOriginUsage()); | 461 test_helper_.GetCachedOriginUsage()); |
| 462 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); | 462 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); |
| 463 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written()); | 463 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written()); |
| 464 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status()); | 464 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status()); |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace fileapi | 467 } // namespace fileapi |
| OLD | NEW |