| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/sessions/session_service_test_helper.h" | 5 #include "chrome/browser/sessions/session_service_test_helper.h" |
| 6 | 6 |
| 7 #include "base/scoped_vector.h" | 7 #include "base/scoped_vector.h" |
| 8 #include "chrome/browser/sessions/session_backend.h" | 8 #include "chrome/browser/sessions/session_backend.h" |
| 9 #include "chrome/browser/sessions/session_id.h" | 9 #include "chrome/browser/sessions/session_id.h" |
| 10 #include "chrome/browser/sessions/session_service.h" | 10 #include "chrome/browser/sessions/session_service.h" |
| 11 #include "chrome/browser/sessions/session_types.h" | 11 #include "chrome/browser/sessions/session_types.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using base::Time; | 14 using base::Time; |
| 15 | 15 |
| 16 SessionServiceTestHelper::SessionServiceTestHelper() {} |
| 17 |
| 18 SessionServiceTestHelper::SessionServiceTestHelper(SessionService* service) |
| 19 : service_(service) {} |
| 20 |
| 21 SessionServiceTestHelper::~SessionServiceTestHelper() {} |
| 22 |
| 16 void SessionServiceTestHelper::RestoreSessionFromCommands( | 23 void SessionServiceTestHelper::RestoreSessionFromCommands( |
| 17 const std::vector<SessionCommand*>& commands, | 24 const std::vector<SessionCommand*>& commands, |
| 18 std::vector<SessionWindow*>* valid_windows) { | 25 std::vector<SessionWindow*>* valid_windows) { |
| 19 service()->RestoreSessionFromCommands(commands, valid_windows); | 26 service()->RestoreSessionFromCommands(commands, valid_windows); |
| 20 } | 27 } |
| 21 | 28 |
| 22 void SessionServiceTestHelper::PrepareTabInWindow(const SessionID& window_id, | 29 void SessionServiceTestHelper::PrepareTabInWindow(const SessionID& window_id, |
| 23 const SessionID& tab_id, | 30 const SessionID& tab_id, |
| 24 int visual_index, | 31 int visual_index, |
| 25 bool select) { | 32 bool select) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 const std::vector<SessionWindow*>& windows, | 88 const std::vector<SessionWindow*>& windows, |
| 82 size_t nav_count) { | 89 size_t nav_count) { |
| 83 ASSERT_EQ(1U, windows.size()); | 90 ASSERT_EQ(1U, windows.size()); |
| 84 EXPECT_EQ(1U, windows[0]->tabs.size()); | 91 EXPECT_EQ(1U, windows[0]->tabs.size()); |
| 85 EXPECT_EQ(nav_count, windows[0]->tabs[0]->navigations.size()); | 92 EXPECT_EQ(nav_count, windows[0]->tabs[0]->navigations.size()); |
| 86 } | 93 } |
| 87 | 94 |
| 88 SessionBackend* SessionServiceTestHelper::backend() { | 95 SessionBackend* SessionServiceTestHelper::backend() { |
| 89 return service_->backend(); | 96 return service_->backend(); |
| 90 } | 97 } |
| OLD | NEW |