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

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

Issue 2687353003: Created SerializableUserDataManager. (Closed)
Patch Set: Eugene's comments Created 3 years, 10 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 void RestoreSession(SessionWindowIOS* window) { 177 void RestoreSession(SessionWindowIOS* window) {
178 [tab_model_ restoreSessionWindow:window]; 178 [tab_model_ restoreSessionWindow:window];
179 } 179 }
180 180
181 // Creates a session window with |entries| entries and a |selectedIndex| of 1. 181 // Creates a session window with |entries| entries and a |selectedIndex| of 1.
182 SessionWindowIOS* CreateSessionWindow(int entries) { 182 SessionWindowIOS* CreateSessionWindow(int entries) {
183 SessionWindowIOS* window = [[SessionWindowIOS alloc] init]; 183 SessionWindowIOS* window = [[SessionWindowIOS alloc] init];
184 for (int i = 0; i < entries; i++) { 184 for (int i = 0; i < entries; i++) {
185 NSString* windowName = [NSString stringWithFormat:@"window %d", i + 1]; 185 NSString* windowName = [NSString stringWithFormat:@"window %d", i + 1];
186 [window addSerializedSession:CreateWebState(windowName) 186 [window addSerializedSessionStorage:CreateWebState(windowName)
187 ->BuildSerializedNavigationManager()]; 187 ->BuildSessionStorage()];
188 } 188 }
189 if (entries) 189 if (entries)
190 [window setSelectedIndex:1]; 190 [window setSelectedIndex:1];
191 return window; 191 return window;
192 } 192 }
193 193
194 web::TestWebThreadBundle thread_bundle_; 194 web::TestWebThreadBundle thread_bundle_;
195 IOSChromeScopedTestingChromeBrowserStateManager scoped_browser_state_manager_; 195 IOSChromeScopedTestingChromeBrowserStateManager scoped_browser_state_manager_;
196 web::ScopedTestingWebClient web_client_; 196 web::ScopedTestingWebClient web_client_;
197 base::scoped_nsobject<SessionWindowIOS> session_window_; 197 base::scoped_nsobject<SessionWindowIOS> session_window_;
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 // Restoring TabModel session sends asynchronous tasks to IO thread, wait 882 // Restoring TabModel session sends asynchronous tasks to IO thread, wait
883 // for them to complete after destroying the TabModel. 883 // for them to complete after destroying the TabModel.
884 base::RunLoop().RunUntilIdle(); 884 base::RunLoop().RunUntilIdle();
885 885
886 // Clean up. 886 // Clean up.
887 EXPECT_TRUE([[NSFileManager defaultManager] removeItemAtPath:stashPath 887 EXPECT_TRUE([[NSFileManager defaultManager] removeItemAtPath:stashPath
888 error:nullptr]); 888 error:nullptr]);
889 } 889 }
890 890
891 } // anonymous namespace 891 } // 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