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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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(const GURL& origin, quota::StorageType type, |
52 GetUsageAndQuotaCallback* callback) { | 52 GetUsageAndQuotaCallback callback) OVERRIDE { |
awong
2011/09/29 18:05:15
const &.
tzik
2011/10/11 04:53:57
Done.
| |
53 callback->Run(quota::kQuotaStatusOk, usage_, quota_); | 53 callback.Run(quota::kQuotaStatusOk, usage_, quota_); |
54 delete callback; | |
55 } | 54 } |
56 | 55 |
57 void set_usage(int64 usage) { usage_ = usage; } | 56 void set_usage(int64 usage) { usage_ = usage; } |
58 void set_quota(int64 quota) { quota_ = quota; } | 57 void set_quota(int64 quota) { quota_ = quota; } |
59 | 58 |
60 private: | 59 private: |
61 int64 usage_; | 60 int64 usage_; |
62 int64 quota_; | 61 int64 quota_; |
63 }; | 62 }; |
64 | 63 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 url_request_context->blob_storage_controller()->UnregisterBlobUrl(blob_url); | 337 url_request_context->blob_storage_controller()->UnregisterBlobUrl(blob_url); |
339 | 338 |
340 EXPECT_EQ(10, bytes_written()); | 339 EXPECT_EQ(10, bytes_written()); |
341 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); | 340 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); |
342 EXPECT_TRUE(complete()); | 341 EXPECT_TRUE(complete()); |
343 } | 342 } |
344 | 343 |
345 // TODO(ericu,dmikurube): Add tests for Cancel. | 344 // TODO(ericu,dmikurube): Add tests for Cancel. |
346 | 345 |
347 } // namespace fileapi | 346 } // namespace fileapi |
OLD | NEW |