| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) | 5 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) |
| 6 // rather than as part of test_shell_tests because they rely on being able | 6 // rather than as part of test_shell_tests because they rely on being able |
| 7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses | 7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses |
| 8 // TYPE_UI, which URLRequest doesn't allow. | 8 // TYPE_UI, which URLRequest doesn't allow. |
| 9 // | 9 // |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 class MockQuotaManager : public QuotaManager { | 41 class MockQuotaManager : public QuotaManager { |
| 42 public: | 42 public: |
| 43 MockQuotaManager(const FilePath& base_dir, int64 quota) | 43 MockQuotaManager(const FilePath& base_dir, int64 quota) |
| 44 : QuotaManager(false /* is_incognito */, base_dir, | 44 : QuotaManager(false /* is_incognito */, base_dir, |
| 45 base::MessageLoopProxy::current(), | 45 base::MessageLoopProxy::current(), |
| 46 base::MessageLoopProxy::current(), | 46 base::MessageLoopProxy::current(), |
| 47 NULL /* special_storage_policy */), | 47 NULL /* special_storage_policy */), |
| 48 usage_(0), | 48 usage_(0), |
| 49 quota_(quota) {} | 49 quota_(quota) {} |
| 50 | 50 |
| 51 virtual void GetUsageAndQuota(const GURL& origin, quota::StorageType type, | 51 virtual void GetUsageAndQuota( |
| 52 GetUsageAndQuotaCallback* callback) { | 52 const GURL& origin, quota::StorageType type, |
| 53 callback->Run(quota::kQuotaStatusOk, usage_, quota_); | 53 const GetUsageAndQuotaCallback& callback) OVERRIDE { |
| 54 delete callback; | 54 callback.Run(quota::kQuotaStatusOk, usage_, quota_); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void set_usage(int64 usage) { usage_ = usage; } | 57 void set_usage(int64 usage) { usage_ = usage; } |
| 58 void set_quota(int64 quota) { quota_ = quota; } | 58 void set_quota(int64 quota) { quota_ = quota; } |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 int64 usage_; | 61 int64 usage_; |
| 62 int64 quota_; | 62 int64 quota_; |
| 63 }; | 63 }; |
| 64 | 64 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 url_request_context->blob_storage_controller()->UnregisterBlobUrl(blob_url); | 338 url_request_context->blob_storage_controller()->UnregisterBlobUrl(blob_url); |
| 339 | 339 |
| 340 EXPECT_EQ(10, bytes_written()); | 340 EXPECT_EQ(10, bytes_written()); |
| 341 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); | 341 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); |
| 342 EXPECT_TRUE(complete()); | 342 EXPECT_TRUE(complete()); |
| 343 } | 343 } |
| 344 | 344 |
| 345 // TODO(ericu,dmikurube): Add tests for Cancel. | 345 // TODO(ericu,dmikurube): Add tests for Cancel. |
| 346 | 346 |
| 347 } // namespace fileapi | 347 } // namespace fileapi |
| OLD | NEW |