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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class MockQuotaManager : public QuotaManager { | 43 class MockQuotaManager : public QuotaManager { |
44 public: | 44 public: |
45 MockQuotaManager(const FilePath& base_dir, int64 quota) | 45 MockQuotaManager(const FilePath& base_dir, int64 quota) |
46 : QuotaManager(false /* is_incognito */, base_dir, | 46 : QuotaManager(false /* is_incognito */, base_dir, |
47 base::MessageLoopProxy::current(), | 47 base::MessageLoopProxy::current(), |
48 base::MessageLoopProxy::current(), | 48 base::MessageLoopProxy::current(), |
49 NULL /* special_storage_policy */), | 49 NULL /* special_storage_policy */), |
50 usage_(0), | 50 usage_(0), |
51 quota_(quota) {} | 51 quota_(quota) {} |
52 | 52 |
53 virtual void GetUsageAndQuota(const GURL& origin, quota::StorageType type, | 53 virtual void GetUsageAndQuota( |
54 GetUsageAndQuotaCallback* callback) { | 54 const GURL& origin, quota::StorageType type, |
55 callback->Run(quota::kQuotaStatusOk, usage_, quota_); | 55 const GetUsageAndQuotaCallback& callback) OVERRIDE { |
56 delete callback; | 56 callback.Run(quota::kQuotaStatusOk, usage_, quota_); |
57 } | 57 } |
58 | 58 |
59 void set_usage(int64 usage) { usage_ = usage; } | 59 void set_usage(int64 usage) { usage_ = usage; } |
60 void set_quota(int64 quota) { quota_ = quota; } | 60 void set_quota(int64 quota) { quota_ = quota; } |
61 | 61 |
62 private: | 62 private: |
63 int64 usage_; | 63 int64 usage_; |
64 int64 quota_; | 64 int64 quota_; |
65 }; | 65 }; |
66 | 66 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 url_request_context->blob_storage_controller()->RemoveBlob(blob_url); | 340 url_request_context->blob_storage_controller()->RemoveBlob(blob_url); |
341 | 341 |
342 EXPECT_EQ(10, bytes_written()); | 342 EXPECT_EQ(10, bytes_written()); |
343 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); | 343 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); |
344 EXPECT_TRUE(complete()); | 344 EXPECT_TRUE(complete()); |
345 } | 345 } |
346 | 346 |
347 // TODO(ericu,dmikurube): Add tests for Cancel. | 347 // TODO(ericu,dmikurube): Add tests for Cancel. |
348 | 348 |
349 } // namespace fileapi | 349 } // namespace fileapi |
OLD | NEW |