| 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/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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 // The form data contained passwords, so it's removed completely. | 576 // The form data contained passwords, so it's removed completely. |
| 577 CheckFormRestored(new_browser, false, false); | 577 CheckFormRestored(new_browser, false, false); |
| 578 } | 578 } |
| 579 | 579 |
| 580 // ChromeOS does not override the SessionStartupPreference upon controlled | 580 // ChromeOS does not override the SessionStartupPreference upon controlled |
| 581 // system restart. | 581 // system restart. |
| 582 #if !defined(OS_CHROMEOS) | 582 #if !defined(OS_CHROMEOS) |
| 583 class RestartTest : public BetterSessionRestoreTest { | 583 class RestartTest : public BetterSessionRestoreTest { |
| 584 public: | 584 public: |
| 585 RestartTest() { } | 585 RestartTest() { } |
| 586 virtual ~RestartTest() { } | 586 ~RestartTest() override {} |
| 587 |
| 587 protected: | 588 protected: |
| 588 void Restart() { | 589 void Restart() { |
| 589 // Simulate restarting the browser, but let the test exit peacefully. | 590 // Simulate restarting the browser, but let the test exit peacefully. |
| 590 for (chrome::BrowserIterator it; !it.done(); it.Next()) | 591 for (chrome::BrowserIterator it; !it.done(); it.Next()) |
| 591 content::BrowserContext::SaveSessionState(it->profile()); | 592 content::BrowserContext::SaveSessionState(it->profile()); |
| 592 PrefService* pref_service = g_browser_process->local_state(); | 593 PrefService* pref_service = g_browser_process->local_state(); |
| 593 pref_service->SetBoolean(prefs::kWasRestarted, true); | 594 pref_service->SetBoolean(prefs::kWasRestarted, true); |
| 594 #if defined(OS_WIN) | 595 #if defined(OS_WIN) |
| 595 if (pref_service->HasPrefPath(prefs::kRelaunchMode)) | 596 if (pref_service->HasPrefPath(prefs::kRelaunchMode)) |
| 596 pref_service->ClearPref(prefs::kRelaunchMode); | 597 pref_service->ClearPref(prefs::kRelaunchMode); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 CookieSettings::Factory::GetForProfile(new_browser->profile())-> | 837 CookieSettings::Factory::GetForProfile(new_browser->profile())-> |
| 837 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); | 838 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); |
| 838 // ... even if background mode is active. | 839 // ... even if background mode is active. |
| 839 EnableBackgroundMode(); | 840 EnableBackgroundMode(); |
| 840 new_browser = QuitBrowserAndRestore(new_browser, true); | 841 new_browser = QuitBrowserAndRestore(new_browser, true); |
| 841 StoreDataWithPage(new_browser, "cookies.html"); | 842 StoreDataWithPage(new_browser, "cookies.html"); |
| 842 DisableBackgroundMode(); | 843 DisableBackgroundMode(); |
| 843 new_browser = QuitBrowserAndRestore(new_browser, true); | 844 new_browser = QuitBrowserAndRestore(new_browser, true); |
| 844 StoreDataWithPage(new_browser, "cookies.html"); | 845 StoreDataWithPage(new_browser, "cookies.html"); |
| 845 } | 846 } |
| OLD | NEW |