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

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

Issue 1087063003: [Session restore] Expose lazy mode and fix browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky@ review. Created 5 years, 8 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 | « no previous file | chrome/browser/sessions/session_restore.h » ('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 (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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 void CheckReloadedPageRestored() { 208 void CheckReloadedPageRestored() {
209 CheckTitle(browser(), title_pass_); 209 CheckTitle(browser(), title_pass_);
210 } 210 }
211 211
212 void CheckReloadedPageRestored(Browser* browser) { 212 void CheckReloadedPageRestored(Browser* browser) {
213 CheckTitle(browser, title_pass_); 213 CheckTitle(browser, title_pass_);
214 } 214 }
215 215
216 void CheckReloadedPageNotRestored() { 216 void CheckReloadedPageNotRestored() {
217 // If only active tabs are loaded, force loading of the tabs.
218 if (SessionRestore::WillLoadActiveTabsOnly()) {
219 for (int i = 0; i < browser()->tab_strip_model()->count(); i++) {
220 content::WebContents* web_contents =
221 browser()->tab_strip_model()->GetWebContentsAt(i);
222 web_contents->GetController().LoadIfNecessary();
223 }
224 }
217 CheckReloadedPageNotRestored(browser()); 225 CheckReloadedPageNotRestored(browser());
218 } 226 }
219 227
220 void CheckReloadedPageNotRestored(Browser* browser) { 228 void CheckReloadedPageNotRestored(Browser* browser) {
221 CheckTitle(browser, title_storing_); 229 CheckTitle(browser, title_storing_);
222 } 230 }
223 231
224 void CheckTitle(Browser* browser, const base::string16& expected_title) { 232 void CheckTitle(Browser* browser, const base::string16& expected_title) {
225 content::WebContents* web_contents = 233 content::WebContents* web_contents =
226 browser->tab_strip_model()->GetWebContentsAt(0); 234 browser->tab_strip_model()->GetWebContentsAt(0);
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 CookieSettings::Factory::GetForProfile(new_browser->profile())-> 843 CookieSettings::Factory::GetForProfile(new_browser->profile())->
836 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); 844 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY);
837 // ... even if background mode is active. 845 // ... even if background mode is active.
838 EnableBackgroundMode(); 846 EnableBackgroundMode();
839 new_browser = QuitBrowserAndRestore(new_browser, true); 847 new_browser = QuitBrowserAndRestore(new_browser, true);
840 StoreDataWithPage(new_browser, "cookies.html"); 848 StoreDataWithPage(new_browser, "cookies.html");
841 DisableBackgroundMode(); 849 DisableBackgroundMode();
842 new_browser = QuitBrowserAndRestore(new_browser, true); 850 new_browser = QuitBrowserAndRestore(new_browser, true);
843 StoreDataWithPage(new_browser, "cookies.html"); 851 StoreDataWithPage(new_browser, "cookies.html");
844 } 852 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698