| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 StartActiveFetcherDuringProfileShutdownTest( | 530 StartActiveFetcherDuringProfileShutdownTest( |
| 531 browser()->profile()->GetRequestContextForExtensions()); | 531 browser()->profile()->GetRequestContextForExtensions()); |
| 532 } | 532 } |
| 533 | 533 |
| 534 // The following tests make sure that it's safe to destroy an incognito profile | 534 // The following tests make sure that it's safe to destroy an incognito profile |
| 535 // while one of the its URLRequestContextGetters is in use by a URLFetcher. | 535 // while one of the its URLRequestContextGetters is in use by a URLFetcher. |
| 536 | 536 |
| 537 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, | 537 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, |
| 538 URLFetcherUsingMainContextDuringIncognitoTeardown) { | 538 URLFetcherUsingMainContextDuringIncognitoTeardown) { |
| 539 Browser* incognito_browser = | 539 Browser* incognito_browser = |
| 540 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), | 540 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); |
| 541 GURL("about:blank")); | |
| 542 RunURLFetcherActiveDuringIncognitoTeardownTest( | 541 RunURLFetcherActiveDuringIncognitoTeardownTest( |
| 543 incognito_browser, incognito_browser->profile()->GetRequestContext()); | 542 incognito_browser, incognito_browser->profile()->GetRequestContext()); |
| 544 } | 543 } |
| 545 | 544 |
| 546 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, | 545 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, |
| 547 URLFetcherUsingExtensionContextDuringIncognitoTeardown) { | 546 URLFetcherUsingExtensionContextDuringIncognitoTeardown) { |
| 548 Browser* incognito_browser = | 547 Browser* incognito_browser = |
| 549 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), | 548 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); |
| 550 GURL("about:blank")); | 549 |
| 551 RunURLFetcherActiveDuringIncognitoTeardownTest( | 550 RunURLFetcherActiveDuringIncognitoTeardownTest( |
| 552 incognito_browser, | 551 incognito_browser, |
| 553 incognito_browser->profile()->GetRequestContextForExtensions()); | 552 incognito_browser->profile()->GetRequestContextForExtensions()); |
| 554 } | 553 } |
| OLD | NEW |