| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 11 #include "base/scoped_temp_dir.h" | |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/defaults.h" | 16 #include "chrome/browser/defaults.h" |
| 17 #include "chrome/browser/sessions/session_backend.h" | 17 #include "chrome/browser/sessions/session_backend.h" |
| 18 #include "chrome/browser/sessions/session_service.h" | 18 #include "chrome/browser/sessions/session_service.h" |
| 19 #include "chrome/browser/sessions/session_service_test_helper.h" | 19 #include "chrome/browser/sessions/session_service_test_helper.h" |
| 20 #include "chrome/browser/sessions/session_types.h" | 20 #include "chrome/browser/sessions/session_types.h" |
| 21 #include "chrome/browser/sessions/session_types_test_helper.h" | 21 #include "chrome/browser/sessions/session_types_test_helper.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 SessionBackend* backend() { return helper_.backend(); } | 160 SessionBackend* backend() { return helper_.backend(); } |
| 161 | 161 |
| 162 const gfx::Rect window_bounds; | 162 const gfx::Rect window_bounds; |
| 163 | 163 |
| 164 SessionID window_id; | 164 SessionID window_id; |
| 165 | 165 |
| 166 int sync_save_count_; | 166 int sync_save_count_; |
| 167 | 167 |
| 168 // Path used in testing. | 168 // Path used in testing. |
| 169 ScopedTempDir temp_dir_; | 169 base::ScopedTempDir temp_dir_; |
| 170 FilePath path_; | 170 FilePath path_; |
| 171 | 171 |
| 172 SessionServiceTestHelper helper_; | 172 SessionServiceTestHelper helper_; |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 TEST_F(SessionServiceTest, Basic) { | 175 TEST_F(SessionServiceTest, Basic) { |
| 176 SessionID tab_id; | 176 SessionID tab_id; |
| 177 ASSERT_NE(window_id.id(), tab_id.id()); | 177 ASSERT_NE(window_id.id(), tab_id.id()); |
| 178 | 178 |
| 179 TabNavigation nav1 = | 179 TabNavigation nav1 = |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 service()->ScheduleCommand( | 966 service()->ScheduleCommand( |
| 967 service()->CreateSetActiveWindowCommand(window_id)); | 967 service()->CreateSetActiveWindowCommand(window_id)); |
| 968 service()->ScheduleCommand( | 968 service()->ScheduleCommand( |
| 969 service()->CreateSetActiveWindowCommand(window2_id)); | 969 service()->CreateSetActiveWindowCommand(window2_id)); |
| 970 | 970 |
| 971 ScopedVector<SessionWindow> windows; | 971 ScopedVector<SessionWindow> windows; |
| 972 SessionID::id_type active_window_id = 0; | 972 SessionID::id_type active_window_id = 0; |
| 973 ReadWindows(&(windows.get()), &active_window_id); | 973 ReadWindows(&(windows.get()), &active_window_id); |
| 974 EXPECT_EQ(window2_id.id(), active_window_id); | 974 EXPECT_EQ(window2_id.id(), active_window_id); |
| 975 } | 975 } |
| OLD | NEW |