| 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "content/public/common/context_menu_params.h" | 71 #include "content/public/common/context_menu_params.h" |
| 72 #include "content/public/common/page_transition_types.h" | 72 #include "content/public/common/page_transition_types.h" |
| 73 #include "content/public/test/browser_test_utils.h" | 73 #include "content/public/test/browser_test_utils.h" |
| 74 #include "content/public/test/download_test_observer.h" | 74 #include "content/public/test/download_test_observer.h" |
| 75 #include "content/public/test/test_file_error_injector.h" | 75 #include "content/public/test/test_file_error_injector.h" |
| 76 #include "content/public/test/test_navigation_observer.h" | 76 #include "content/public/test/test_navigation_observer.h" |
| 77 #include "content/test/net/url_request_mock_http_job.h" | 77 #include "content/test/net/url_request_mock_http_job.h" |
| 78 #include "content/test/net/url_request_slow_download_job.h" | 78 #include "content/test/net/url_request_slow_download_job.h" |
| 79 #include "grit/generated_resources.h" | 79 #include "grit/generated_resources.h" |
| 80 #include "net/base/net_util.h" | 80 #include "net/base/net_util.h" |
| 81 #include "net/test/spawned_test_server.h" | 81 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 82 #include "testing/gtest/include/gtest/gtest.h" | 82 #include "testing/gtest/include/gtest/gtest.h" |
| 83 #include "ui/base/l10n/l10n_util.h" | 83 #include "ui/base/l10n/l10n_util.h" |
| 84 #include "webkit/plugins/npapi/mock_plugin_list.h" | 84 #include "webkit/plugins/npapi/mock_plugin_list.h" |
| 85 | 85 |
| 86 using content::BrowserContext; | 86 using content::BrowserContext; |
| 87 using content::BrowserThread; | 87 using content::BrowserThread; |
| 88 using content::DownloadItem; | 88 using content::DownloadItem; |
| 89 using content::DownloadManager; | 89 using content::DownloadManager; |
| 90 using content::DownloadUrlParameters; | 90 using content::DownloadUrlParameters; |
| 91 using content::URLRequestMockHTTPJob; | 91 using content::URLRequestMockHTTPJob; |
| (...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2924 scoped_ptr<content::DownloadTestObserver> observer( | 2924 scoped_ptr<content::DownloadTestObserver> observer( |
| 2925 DangerousDownloadWaiter( | 2925 DangerousDownloadWaiter( |
| 2926 browser(), 1, | 2926 browser(), 1, |
| 2927 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); | 2927 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); |
| 2928 ui_test_utils::NavigateToURL(browser(), url); | 2928 ui_test_utils::NavigateToURL(browser(), url); |
| 2929 observer->WaitForFinished(); | 2929 observer->WaitForFinished(); |
| 2930 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::CANCELLED)); | 2930 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::CANCELLED)); |
| 2931 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); | 2931 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); |
| 2932 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 2932 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); |
| 2933 } | 2933 } |
| OLD | NEW |