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 #ifndef COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ | 5 #ifndef COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ |
6 #define COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ | 6 #define COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "components/drive/file_cache.h" | 12 #include "components/drive/file_cache.h" |
11 #include "content/public/test/test_utils.h" | 13 #include "content/public/test/test_utils.h" |
12 #include "google_apis/drive/test_util.h" | 14 #include "google_apis/drive/test_util.h" |
13 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
14 #include "net/base/io_buffer.h" | 16 #include "net/base/io_buffer.h" |
15 #include "net/base/network_change_notifier.h" | 17 #include "net/base/network_change_notifier.h" |
16 #include "net/base/test_completion_callback.h" | 18 #include "net/base/test_completion_callback.h" |
17 | 19 |
18 class PrefRegistrySimple; | 20 class PrefRegistrySimple; |
19 | 21 |
20 namespace net { | 22 namespace net { |
21 class IOBuffer; | 23 class IOBuffer; |
22 } // namespace net | 24 } // namespace net |
23 | 25 |
24 namespace drive { | 26 namespace drive { |
25 | 27 |
26 namespace test_util { | 28 namespace test_util { |
27 | 29 |
28 // Disk space size used by FakeFreeDiskSpaceGetter. | 30 // Disk space size used by FakeFreeDiskSpaceGetter. |
29 const int64 kLotsOfSpace = drive::internal::kMinFreeSpaceInBytes * 10; | 31 const int64_t kLotsOfSpace = drive::internal::kMinFreeSpaceInBytes * 10; |
30 | 32 |
31 // Helper to destroy objects which needs Destroy() to be called on destruction. | 33 // Helper to destroy objects which needs Destroy() to be called on destruction. |
32 // Note: When using this helper, you should destruct objects before | 34 // Note: When using this helper, you should destruct objects before |
33 // BrowserThread. | 35 // BrowserThread. |
34 struct DestroyHelperForTests { | 36 struct DestroyHelperForTests { |
35 template<typename T> | 37 template<typename T> |
36 void operator()(T* object) const { | 38 void operator()(T* object) const { |
37 if (object) { | 39 if (object) { |
38 object->Destroy(); | 40 object->Destroy(); |
39 content::RunAllBlockingPoolTasksUntilIdle(); // Finish destruction. | 41 content::RunAllBlockingPoolTasksUntilIdle(); // Finish destruction. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 ConnectionType GetCurrentConnectionType() const override; | 77 ConnectionType GetCurrentConnectionType() const override; |
76 | 78 |
77 private: | 79 private: |
78 net::NetworkChangeNotifier::ConnectionType type_; | 80 net::NetworkChangeNotifier::ConnectionType type_; |
79 }; | 81 }; |
80 | 82 |
81 } // namespace test_util | 83 } // namespace test_util |
82 } // namespace drive | 84 } // namespace drive |
83 | 85 |
84 #endif // COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ | 86 #endif // COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_ |
OLD | NEW |