| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import <objc/runtime.h> | 5 #import <objc/runtime.h> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 void RestoreSession(SessionWindowIOS* window) { | 187 void RestoreSession(SessionWindowIOS* window) { |
| 188 [tab_model_ restoreSessionWindow:window]; | 188 [tab_model_ restoreSessionWindow:window]; |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Creates a session window with |entries| entries and a |selectedIndex| of 1. | 191 // Creates a session window with |entries| entries and a |selectedIndex| of 1. |
| 192 SessionWindowIOS* CreateSessionWindow(int entries) { | 192 SessionWindowIOS* CreateSessionWindow(int entries) { |
| 193 SessionWindowIOS* window = [[SessionWindowIOS alloc] init]; | 193 SessionWindowIOS* window = [[SessionWindowIOS alloc] init]; |
| 194 for (int i = 0; i < entries; i++) { | 194 for (int i = 0; i < entries; i++) { |
| 195 NSString* windowName = [NSString stringWithFormat:@"window %d", i + 1]; | 195 NSString* windowName = [NSString stringWithFormat:@"window %d", i + 1]; |
| 196 [window addSession:CreateWebState(windowName)]; | 196 [window addSerializedSession:CreateWebState(windowName) |
| 197 ->BuildSerializedNavigationManager()]; |
| 197 } | 198 } |
| 198 if (entries) | 199 if (entries) |
| 199 [window setSelectedIndex:1]; | 200 [window setSelectedIndex:1]; |
| 200 return window; | 201 return window; |
| 201 } | 202 } |
| 202 | 203 |
| 203 web::TestWebThreadBundle thread_bundle_; | 204 web::TestWebThreadBundle thread_bundle_; |
| 204 IOSChromeScopedTestingChromeBrowserStateManager scoped_browser_state_manager_; | 205 IOSChromeScopedTestingChromeBrowserStateManager scoped_browser_state_manager_; |
| 205 web::ScopedTestingWebClient web_client_; | 206 web::ScopedTestingWebClient web_client_; |
| 206 base::scoped_nsobject<SessionWindowIOS> session_window_; | 207 base::scoped_nsobject<SessionWindowIOS> session_window_; |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 browserState:chrome_browser_state.get()]); | 876 browserState:chrome_browser_state.get()]); |
| 876 EXPECT_EQ(model.get().currentTab, [model tabAtIndex:1]); | 877 EXPECT_EQ(model.get().currentTab, [model tabAtIndex:1]); |
| 877 [model browserStateDestroyed]; | 878 [model browserStateDestroyed]; |
| 878 | 879 |
| 879 // Clean up. | 880 // Clean up. |
| 880 EXPECT_TRUE([[NSFileManager defaultManager] removeItemAtPath:stashPath | 881 EXPECT_TRUE([[NSFileManager defaultManager] removeItemAtPath:stashPath |
| 881 error:nullptr]); | 882 error:nullptr]); |
| 882 } | 883 } |
| 883 | 884 |
| 884 } // anonymous namespace | 885 } // anonymous namespace |
| OLD | NEW |