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 #include "components/sessions/base_session_service_test_helper.h"
7 #include "components/sessions/base_session_service.h"
8 #include "components/sessions/session_backend.h"
12 BaseSessionServiceTestHelper::BaseSessionServiceTestHelper(
13 BaseSessionService
* base_session_service
)
14 : base_session_service_(base_session_service
) {
15 CHECK(base_session_service
);
18 BaseSessionServiceTestHelper::~BaseSessionServiceTestHelper() {
21 void BaseSessionServiceTestHelper::RunTaskOnBackendThread(
22 const tracked_objects::Location
& from_here
,
23 const base::Closure
& task
) {
24 base_session_service_
->RunTaskOnBackendThread(from_here
, task
);
27 bool BaseSessionServiceTestHelper::ProcessedAnyCommands() {
28 return base_session_service_
->backend_
->inited() ||
29 !base_session_service_
->pending_commands().empty();
32 bool BaseSessionServiceTestHelper::ReadLastSessionCommands(
33 ScopedVector
<SessionCommand
>* commands
) {
34 return base_session_service_
->backend_
->ReadLastSessionCommandsImpl(commands
);
37 } // namespace sessions