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

Side by Side Diff: ios/chrome/browser/tabs/tab_model_unittest.mm

Issue 1360993002: Moved NavigationManagerImpl serialization out of CRWSessionController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compilation fix after rebase Created 3 years, 11 months 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
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/web/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/web/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698