Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/sessions/session_service_test_helper.cc

Issue 685133004: Handling |SessionCommand|s as scoped_ptr's (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/sessions/session_service_test_helper.h" 5 #include "chrome/browser/sessions/session_service_test_helper.h"
6 6
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/sessions/session_backend.h" 9 #include "chrome/browser/sessions/session_backend.h"
10 #include "chrome/browser/sessions/session_service.h" 10 #include "chrome/browser/sessions/session_service.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 service()->force_browser_not_alive_with_no_windows_ = 53 service()->force_browser_not_alive_with_no_windows_ =
54 force_browser_not_alive_with_no_windows; 54 force_browser_not_alive_with_no_windows;
55 } 55 }
56 56
57 // Be sure and null out service to force closing the file. 57 // Be sure and null out service to force closing the file.
58 void SessionServiceTestHelper::ReadWindows( 58 void SessionServiceTestHelper::ReadWindows(
59 std::vector<SessionWindow*>* windows, 59 std::vector<SessionWindow*>* windows,
60 SessionID::id_type* active_window_id) { 60 SessionID::id_type* active_window_id) {
61 Time last_time; 61 Time last_time;
62 ScopedVector<SessionCommand> read_commands; 62 ScopedVector<SessionCommand> read_commands;
63 backend()->ReadLastSessionCommandsImpl(&(read_commands.get())); 63 backend()->ReadLastSessionCommandsImpl(&read_commands);
64 RestoreSessionFromCommands(read_commands.get(), windows, active_window_id); 64 RestoreSessionFromCommands(read_commands, windows, active_window_id);
65 service()->RemoveUnusedRestoreWindows(windows); 65 service()->RemoveUnusedRestoreWindows(windows);
66 } 66 }
67 67
68 void SessionServiceTestHelper::AssertTabEquals(const SessionID& window_id, 68 void SessionServiceTestHelper::AssertTabEquals(const SessionID& window_id,
69 const SessionID& tab_id, 69 const SessionID& tab_id,
70 int visual_index, 70 int visual_index,
71 int nav_index, 71 int nav_index,
72 size_t nav_count, 72 size_t nav_count,
73 const SessionTab& session_tab) { 73 const SessionTab& session_tab) {
74 EXPECT_EQ(window_id.id(), session_tab.window_id.id()); 74 EXPECT_EQ(window_id.id(), session_tab.window_id.id());
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 service_.reset(service); 111 service_.reset(service);
112 // Execute IO tasks posted by the SessionService. 112 // Execute IO tasks posted by the SessionService.
113 content::RunAllBlockingPoolTasksUntilIdle(); 113 content::RunAllBlockingPoolTasksUntilIdle();
114 } 114 }
115 115
116 void SessionServiceTestHelper::RunTaskOnBackendThread( 116 void SessionServiceTestHelper::RunTaskOnBackendThread(
117 const tracked_objects::Location& from_here, 117 const tracked_objects::Location& from_here,
118 const base::Closure& task) { 118 const base::Closure& task) {
119 service_->RunTaskOnBackendThread(from_here, task); 119 service_->RunTaskOnBackendThread(from_here, task);
120 } 120 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service_commands.cc ('k') | chrome/browser/sessions/session_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698