| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 // Normally localStorage is persisted. | 734 // Normally localStorage is persisted. |
| 735 content::WebContents* web_contents = | 735 content::WebContents* web_contents = |
| 736 browser()->tab_strip_model()->GetActiveWebContents(); | 736 browser()->tab_strip_model()->GetActiveWebContents(); |
| 737 EXPECT_EQ(std::string(url::kAboutBlankURL), web_contents->GetURL().spec()); | 737 EXPECT_EQ(std::string(url::kAboutBlankURL), web_contents->GetURL().spec()); |
| 738 NavigateAndCheckStoredData("local_storage.html"); | 738 NavigateAndCheckStoredData("local_storage.html"); |
| 739 // ... but not if it's set to clear on exit. | 739 // ... but not if it's set to clear on exit. |
| 740 CookieSettingsFactory::GetForProfile(browser()->profile()) | 740 CookieSettingsFactory::GetForProfile(browser()->profile()) |
| 741 ->SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); | 741 ->SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); |
| 742 } | 742 } |
| 743 | 743 |
| 744 IN_PROC_BROWSER_TEST_F(NoSessionRestoreTest, LocalStorageClearedOnExit) { | 744 // Crashes on Windows. http://crbug.com/732013 |
| 745 #if defined(OS_WIN) |
| 746 #define MAYBE_NSRT_LocalStorageClearedOnExit DISABLED_LocalStorageClearedOnExit |
| 747 #else |
| 748 #define MAYBE_NSRT_LocalStorageClearedOnExit LocalStorageClearedOnExit |
| 749 #endif |
| 750 IN_PROC_BROWSER_TEST_F(NoSessionRestoreTest, |
| 751 MAYBE_NSRT_LocalStorageClearedOnExit) { |
| 745 content::WebContents* web_contents = | 752 content::WebContents* web_contents = |
| 746 browser()->tab_strip_model()->GetActiveWebContents(); | 753 browser()->tab_strip_model()->GetActiveWebContents(); |
| 747 EXPECT_EQ(std::string(url::kAboutBlankURL), web_contents->GetURL().spec()); | 754 EXPECT_EQ(std::string(url::kAboutBlankURL), web_contents->GetURL().spec()); |
| 748 StoreDataWithPage("local_storage.html"); | 755 StoreDataWithPage("local_storage.html"); |
| 749 } | 756 } |
| 750 | 757 |
| 751 IN_PROC_BROWSER_TEST_F(NoSessionRestoreTest, PRE_PRE_CookiesClearedOnExit) { | 758 IN_PROC_BROWSER_TEST_F(NoSessionRestoreTest, PRE_PRE_CookiesClearedOnExit) { |
| 752 StoreDataWithPage("cookies.html"); | 759 StoreDataWithPage("cookies.html"); |
| 753 } | 760 } |
| 754 | 761 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 CookieSettingsFactory::GetForProfile(new_browser->profile()) | 863 CookieSettingsFactory::GetForProfile(new_browser->profile()) |
| 857 ->SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); | 864 ->SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); |
| 858 // ... even if background mode is active. | 865 // ... even if background mode is active. |
| 859 EnableBackgroundMode(); | 866 EnableBackgroundMode(); |
| 860 new_browser = QuitBrowserAndRestore(new_browser, true); | 867 new_browser = QuitBrowserAndRestore(new_browser, true); |
| 861 StoreDataWithPage(new_browser, "cookies.html"); | 868 StoreDataWithPage(new_browser, "cookies.html"); |
| 862 DisableBackgroundMode(); | 869 DisableBackgroundMode(); |
| 863 new_browser = QuitBrowserAndRestore(new_browser, true); | 870 new_browser = QuitBrowserAndRestore(new_browser, true); |
| 864 StoreDataWithPage(new_browser, "cookies.html"); | 871 StoreDataWithPage(new_browser, "cookies.html"); |
| 865 } | 872 } |
| OLD | NEW |