| OLD | NEW |
| 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 StoreDataWithPage("session_cookies.html"); | 469 StoreDataWithPage("session_cookies.html"); |
| 470 Browser* new_browser = QuitBrowserAndRestore(browser(), false); | 470 Browser* new_browser = QuitBrowserAndRestore(browser(), false); |
| 471 // The browsing session will be continued; just wait for the page to reload | 471 // The browsing session will be continued; just wait for the page to reload |
| 472 // and check the stored data. | 472 // and check the stored data. |
| 473 CheckReloadedPageRestored(new_browser); | 473 CheckReloadedPageRestored(new_browser); |
| 474 } | 474 } |
| 475 | 475 |
| 476 // Test that leaving a popup open will not prevent session restore. | 476 // Test that leaving a popup open will not prevent session restore. |
| 477 IN_PROC_BROWSER_TEST_F(ContinueWhereILeftOffTest, | 477 IN_PROC_BROWSER_TEST_F(ContinueWhereILeftOffTest, |
| 478 SessionCookiesBrowserCloseWithPopupOpen) { | 478 SessionCookiesBrowserCloseWithPopupOpen) { |
| 479 if (browser_defaults::kRestorePopups) | |
| 480 return; | |
| 481 | |
| 482 // Set the startup preference to "continue where I left off" and visit a page | 479 // Set the startup preference to "continue where I left off" and visit a page |
| 483 // which stores a session cookie. | 480 // which stores a session cookie. |
| 484 StoreDataWithPage("session_cookies.html"); | 481 StoreDataWithPage("session_cookies.html"); |
| 485 Browser* popup = new Browser(Browser::CreateParams( | 482 Browser* popup = new Browser(Browser::CreateParams( |
| 486 Browser::TYPE_POPUP, | 483 Browser::TYPE_POPUP, |
| 487 browser()->profile(), | 484 browser()->profile(), |
| 488 chrome::HOST_DESKTOP_TYPE_NATIVE)); | 485 chrome::HOST_DESKTOP_TYPE_NATIVE)); |
| 489 popup->window()->Show(); | 486 popup->window()->Show(); |
| 490 | 487 |
| 491 Browser* new_browser = QuitBrowserAndRestore(browser(), false); | 488 Browser* new_browser = QuitBrowserAndRestore(browser(), false); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 CookieSettings::Factory::GetForProfile(new_browser->profile())-> | 838 CookieSettings::Factory::GetForProfile(new_browser->profile())-> |
| 842 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); | 839 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); |
| 843 // ... even if background mode is active. | 840 // ... even if background mode is active. |
| 844 EnableBackgroundMode(); | 841 EnableBackgroundMode(); |
| 845 new_browser = QuitBrowserAndRestore(new_browser, true); | 842 new_browser = QuitBrowserAndRestore(new_browser, true); |
| 846 StoreDataWithPage(new_browser, "cookies.html"); | 843 StoreDataWithPage(new_browser, "cookies.html"); |
| 847 DisableBackgroundMode(); | 844 DisableBackgroundMode(); |
| 848 new_browser = QuitBrowserAndRestore(new_browser, true); | 845 new_browser = QuitBrowserAndRestore(new_browser, true); |
| 849 StoreDataWithPage(new_browser, "cookies.html"); | 846 StoreDataWithPage(new_browser, "cookies.html"); |
| 850 } | 847 } |
| OLD | NEW |