Fix crash in ResourceLoader if the resources were retrieved before BlockUntilLoaded...
[chromium-blink-merge.git] / components / sessions / base_session_service_test_helper.h
bloba12fb0e74b6e741ca2fc8022e841f6a92c1bb2a1
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.
5 #ifndef COMPONENTS_SESSIONS_BASE_SESSION_SERVICE_TEST_HELPER_H_
6 #define COMPONENTS_SESSIONS_BASE_SESSION_SERVICE_TEST_HELPER_H_
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"
13 namespace sessions {
14 class SessionCommand;
15 class BaseSessionService;
17 class BaseSessionServiceTestHelper {
18 public:
19 explicit BaseSessionServiceTestHelper(
20 BaseSessionService* base_session_service_);
21 ~BaseSessionServiceTestHelper();
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);
28 // Returns true if any commands got processed yet - saved or queued.
29 bool ProcessedAnyCommands();
31 // Read the last session commands directly from file.
32 bool ReadLastSessionCommands(ScopedVector<SessionCommand>* commands);
34 private:
35 BaseSessionService* base_session_service_;
37 DISALLOW_COPY_AND_ASSIGN(BaseSessionServiceTestHelper);
40 } // namespace sessions
42 #endif // COMPONENTS_SESSIONS_BASE_SESSION_SERVICE_TEST_HELPER_H_