| 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 #include <memory> | 6 #include <memory> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 content::BrowserContext::GetDownloadManager(browser()->profile()); | 70 content::BrowserContext::GetDownloadManager(browser()->profile()); |
| 71 std::vector<content::DownloadItem*> downloads; | 71 std::vector<content::DownloadItem*> downloads; |
| 72 download_manager->GetAllDownloads(&downloads); | 72 download_manager->GetAllDownloads(&downloads); |
| 73 EXPECT_EQ(expected, downloads.size()); | 73 EXPECT_EQ(expected, downloads.size()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void DownloadAnItem() { | 76 void DownloadAnItem() { |
| 77 base::ScopedTempDir downloads_directory; | 77 base::ScopedTempDir downloads_directory; |
| 78 ASSERT_TRUE(downloads_directory.CreateUniqueTempDir()); | 78 ASSERT_TRUE(downloads_directory.CreateUniqueTempDir()); |
| 79 browser()->profile()->GetPrefs()->SetFilePath( | 79 browser()->profile()->GetPrefs()->SetFilePath( |
| 80 prefs::kDownloadDefaultDirectory, downloads_directory.path()); | 80 prefs::kDownloadDefaultDirectory, downloads_directory.GetPath()); |
| 81 | 81 |
| 82 // Start a download. | 82 // Start a download. |
| 83 content::DownloadManager* download_manager = | 83 content::DownloadManager* download_manager = |
| 84 content::BrowserContext::GetDownloadManager(browser()->profile()); | 84 content::BrowserContext::GetDownloadManager(browser()->profile()); |
| 85 std::unique_ptr<content::DownloadTestObserver> observer( | 85 std::unique_ptr<content::DownloadTestObserver> observer( |
| 86 new content::DownloadTestObserverTerminal( | 86 new content::DownloadTestObserverTerminal( |
| 87 download_manager, 1, | 87 download_manager, 1, |
| 88 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); | 88 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); |
| 89 | 89 |
| 90 GURL download_url = ui_test_utils::GetTestUrl( | 90 GURL download_url = ui_test_utils::GetTestUrl( |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 base::RunLoop run_loop; | 295 base::RunLoop run_loop; |
| 296 BrowserThread::PostTaskAndReply( | 296 BrowserThread::PostTaskAndReply( |
| 297 BrowserThread::IO, FROM_HERE, | 297 BrowserThread::IO, FROM_HERE, |
| 298 base::Bind(&BrowsingDataRemoverTransportSecurityStateBrowserTest:: | 298 base::Bind(&BrowsingDataRemoverTransportSecurityStateBrowserTest:: |
| 299 CheckTransportSecurityState, | 299 CheckTransportSecurityState, |
| 300 base::Unretained(this), | 300 base::Unretained(this), |
| 301 base::RetainedRef(browser()->profile()->GetRequestContext()), | 301 base::RetainedRef(browser()->profile()->GetRequestContext()), |
| 302 false /* should not be cleared */), | 302 false /* should not be cleared */), |
| 303 run_loop.QuitClosure()); | 303 run_loop.QuitClosure()); |
| 304 } | 304 } |
| OLD | NEW |