| 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 "chrome/browser/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 browser()->profile()->GetRequestContext()); | 762 browser()->profile()->GetRequestContext()); |
| 763 } | 763 } |
| 764 | 764 |
| 765 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, | 765 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, |
| 766 URLFetcherUsingMediaContextDuringShutdown) { | 766 URLFetcherUsingMediaContextDuringShutdown) { |
| 767 StartActiveFetcherDuringProfileShutdownTest( | 767 StartActiveFetcherDuringProfileShutdownTest( |
| 768 content::BrowserContext::GetDefaultStoragePartition( | 768 content::BrowserContext::GetDefaultStoragePartition( |
| 769 browser()->profile())->GetMediaURLRequestContext()); | 769 browser()->profile())->GetMediaURLRequestContext()); |
| 770 } | 770 } |
| 771 | 771 |
| 772 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, | |
| 773 URLFetcherUsingExtensionContextDuringShutdown) { | |
| 774 StartActiveFetcherDuringProfileShutdownTest( | |
| 775 browser()->profile()->GetRequestContextForExtensions()); | |
| 776 } | |
| 777 | |
| 778 // The following tests make sure that it's safe to destroy an incognito profile | 772 // The following tests make sure that it's safe to destroy an incognito profile |
| 779 // while one of the its URLRequestContextGetters is in use by a URLFetcher. | 773 // while one of the its URLRequestContextGetters is in use by a URLFetcher. |
| 780 | 774 |
| 781 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, | 775 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, |
| 782 URLFetcherUsingMainContextDuringIncognitoTeardown) { | 776 URLFetcherUsingMainContextDuringIncognitoTeardown) { |
| 783 Browser* incognito_browser = | 777 Browser* incognito_browser = |
| 784 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); | 778 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); |
| 785 RunURLFetcherActiveDuringIncognitoTeardownTest( | 779 RunURLFetcherActiveDuringIncognitoTeardownTest( |
| 786 incognito_browser, incognito_browser->profile()->GetRequestContext()); | 780 incognito_browser, incognito_browser->profile()->GetRequestContext()); |
| 787 } | 781 } |
| 788 | 782 |
| 789 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, | |
| 790 URLFetcherUsingExtensionContextDuringIncognitoTeardown) { | |
| 791 Browser* incognito_browser = | |
| 792 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); | |
| 793 | |
| 794 RunURLFetcherActiveDuringIncognitoTeardownTest( | |
| 795 incognito_browser, | |
| 796 incognito_browser->profile()->GetRequestContextForExtensions()); | |
| 797 } | |
| 798 | |
| 799 // Verifies the cache directory supports multiple profiles when it's overriden | 783 // Verifies the cache directory supports multiple profiles when it's overriden |
| 800 // by group policy or command line switches. | 784 // by group policy or command line switches. |
| 801 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, DiskCacheDirOverride) { | 785 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, DiskCacheDirOverride) { |
| 802 base::ThreadRestrictions::ScopedAllowIO allow_io; | 786 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 803 int size; | 787 int size; |
| 804 const base::FilePath::StringPieceType profile_name = | 788 const base::FilePath::StringPieceType profile_name = |
| 805 FILE_PATH_LITERAL("Profile 1"); | 789 FILE_PATH_LITERAL("Profile 1"); |
| 806 base::ScopedTempDir mock_user_data_dir; | 790 base::ScopedTempDir mock_user_data_dir; |
| 807 ASSERT_TRUE(mock_user_data_dir.CreateUniqueTempDir()); | 791 ASSERT_TRUE(mock_user_data_dir.CreateUniqueTempDir()); |
| 808 base::FilePath profile_path = | 792 base::FilePath profile_path = |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 base::Bind(&SendReportHttpResponse, embedded_test_server()->base_url())); | 873 base::Bind(&SendReportHttpResponse, embedded_test_server()->base_url())); |
| 890 ASSERT_TRUE(hpkp_test_server.Start()); | 874 ASSERT_TRUE(hpkp_test_server.Start()); |
| 891 | 875 |
| 892 // To send a report, must use a non-numeric host name for the original | 876 // To send a report, must use a non-numeric host name for the original |
| 893 // request. This must not match the host name of the server that reports are | 877 // request. This must not match the host name of the server that reports are |
| 894 // sent to. | 878 // sent to. |
| 895 ui_test_utils::NavigateToURL(browser(), | 879 ui_test_utils::NavigateToURL(browser(), |
| 896 hpkp_test_server.GetURL("localhost", "/")); | 880 hpkp_test_server.GetURL("localhost", "/")); |
| 897 wait_for_report_loop.Run(); | 881 wait_for_report_loop.Run(); |
| 898 } | 882 } |
| OLD | NEW |