| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_SESSIONS_BASE_SESSION_SERVICE_TEST_HELPER_H_ | |
| 6 #define COMPONENTS_SESSIONS_BASE_SESSION_SERVICE_TEST_HELPER_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/callback.h" | |
| 10 #include "base/memory/scoped_vector.h" | |
| 11 #include "base/task/cancelable_task_tracker.h" | |
| 12 | |
| 13 namespace sessions { | |
| 14 class SessionCommand; | |
| 15 class BaseSessionService; | |
| 16 | |
| 17 class BaseSessionServiceTestHelper { | |
| 18 public: | |
| 19 explicit BaseSessionServiceTestHelper( | |
| 20 BaseSessionService* base_session_service_); | |
| 21 ~BaseSessionServiceTestHelper(); | |
| 22 | |
| 23 // This posts the task to the SequencedWorkerPool, or run immediately | |
| 24 // if the SequencedWorkerPool has been shutdown. | |
| 25 void RunTaskOnBackendThread(const tracked_objects::Location& from_here, | |
| 26 const base::Closure& task); | |
| 27 | |
| 28 // Returns true if any commands got processed yet - saved or queued. | |
| 29 bool ProcessedAnyCommands(); | |
| 30 | |
| 31 // Read the last session commands directly from file. | |
| 32 bool ReadLastSessionCommands(ScopedVector<SessionCommand>* commands); | |
| 33 | |
| 34 private: | |
| 35 BaseSessionService* base_session_service_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(BaseSessionServiceTestHelper); | |
| 38 }; | |
| 39 | |
| 40 } // namespace sessions | |
| 41 | |
| 42 #endif // COMPONENTS_SESSIONS_BASE_SESSION_SERVICE_TEST_HELPER_H_ | |
| OLD | NEW |