| 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 NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ | 5 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ |
| 6 #define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ | 6 #define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Sets the number of callbacks that can be received so far. | 57 // Sets the number of callbacks that can be received so far. |
| 58 void ExpectCallbacks(int num_callbacks) { | 58 void ExpectCallbacks(int num_callbacks) { |
| 59 num_callbacks_ = num_callbacks; | 59 num_callbacks_ = num_callbacks; |
| 60 num_iterations_ = last_ = 0; | 60 num_iterations_ = last_ = 0; |
| 61 completed_ = false; | 61 completed_ = false; |
| 62 } | 62 } |
| 63 | 63 |
| 64 // Called periodically to test if WaitUntilCacheIoFinished should return. | 64 // Called periodically to test if WaitUntilCacheIoFinished should return. |
| 65 void TimerExpired(); | 65 void TimerExpired(); |
| 66 | 66 |
| 67 base::RepeatingTimer<MessageLoopHelper> timer_; | 67 base::RepeatingTimer timer_; |
| 68 int num_callbacks_; | 68 int num_callbacks_; |
| 69 int num_iterations_; | 69 int num_iterations_; |
| 70 int last_; | 70 int last_; |
| 71 bool completed_; | 71 bool completed_; |
| 72 | 72 |
| 73 // True if a callback was called/reused more than expected. | 73 // True if a callback was called/reused more than expected. |
| 74 bool callback_reused_error_; | 74 bool callback_reused_error_; |
| 75 int callbacks_called_; | 75 int callbacks_called_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(MessageLoopHelper); | 77 DISALLOW_COPY_AND_ASSIGN(MessageLoopHelper); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 95 int last_result() const { return last_result_; } | 95 int last_result() const { return last_result_; } |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 MessageLoopHelper* helper_; | 98 MessageLoopHelper* helper_; |
| 99 int reuse_; | 99 int reuse_; |
| 100 int last_result_; | 100 int last_result_; |
| 101 DISALLOW_COPY_AND_ASSIGN(CallbackTest); | 101 DISALLOW_COPY_AND_ASSIGN(CallbackTest); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ | 104 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ |
| OLD | NEW |