Chromium Code Reviews| Index: chrome/browser/extensions/api/system_info_storage/test_storage_info_provider.h |
| diff --git a/chrome/browser/extensions/api/system_info_storage/test_storage_info_provider.h b/chrome/browser/extensions/api/system_info_storage/test_storage_info_provider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4dd4500bcc24ece588abb057d244b566683b3dfe |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/system_info_storage/test_storage_info_provider.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_STORAGE_TEST_STORAGE_INFO_PROVIDER_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_STORAGE_TEST_STORAGE_INFO_PROVIDER_H_ |
| + |
| +#include "chrome/browser/extensions/api/system_info_storage/storage_info_provider.h" |
| +#include "chrome/browser/storage_monitor/storage_info.h" |
| + |
| +struct TestUnitInfo { |
| + const char* device_id; |
| + const char* location; |
| + const char* type; |
| + double capacity; |
|
Lei Zhang
2013/06/25 04:49:55
Mention these are in bytes, or whatever unit.
Haojian Wu
2013/06/26 03:22:40
Done.
|
| + double available_capacity; |
| + // The change step of free space. |
|
Lei Zhang
2013/06/25 04:49:55
I don't understand what exactly this means. If it
Haojian Wu
2013/06/26 03:22:40
The change_step here is used for simulating the fr
|
| + int change_step; |
| +}; |
| + |
| +class TestStorageInfoProvider : public extensions::StorageInfoProvider { |
| + public: |
| + TestStorageInfoProvider(const struct TestUnitInfo testing_data[], size_t n); |
|
Lei Zhang
2013/06/25 04:49:55
I think you can just use a const struct TestUnitIn
Haojian Wu
2013/06/26 03:22:40
Done.
|
| + |
| + static chrome::StorageInfo BuildStorageInfo(const TestUnitInfo& unit); |
| + |
| + protected: |
| + virtual ~TestStorageInfoProvider(); |
| + |
| + // StorageInfoProvider implementations. |
| + virtual bool QueryInfo(extensions::StorageInfo* info) OVERRIDE; |
| + virtual std::vector<chrome::StorageInfo> GetAllStorages() const OVERRIDE; |
| + virtual int64 GetStorageFreeSpace(const base::FilePath& mount_path) OVERRIDE; |
| + |
| + std::vector<struct TestUnitInfo> testing_data_; |
|
Lei Zhang
2013/06/25 04:49:55
#include <vector>
Haojian Wu
2013/06/26 03:22:40
Done.
|
| +}; |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_STORAGE_TEST_STORAGE_INFO_PROVIDER_H_ |
| + |