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 // This file contains download browser tests that are known to be runnable | 5 // This file contains download browser tests that are known to be runnable |
6 // in a pure content context. Over time tests should be migrated here. | 6 // in a pure content context. Over time tests should be migrated here. |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.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" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "content/browser/byte_stream.h" | 16 #include "content/browser/byte_stream.h" |
17 #include "content/browser/download/download_file_factory.h" | 17 #include "content/browser/download/download_file_factory.h" |
18 #include "content/browser/download/download_file_impl.h" | 18 #include "content/browser/download/download_file_impl.h" |
19 #include "content/browser/download/download_item_impl.h" | 19 #include "content/browser/download/download_item_impl.h" |
20 #include "content/browser/download/download_manager_impl.h" | 20 #include "content/browser/download/download_manager_impl.h" |
21 #include "content/browser/download/download_resource_handler.h" | 21 #include "content/browser/download/download_resource_handler.h" |
22 #include "content/browser/plugin_service_impl.h" | |
23 #include "content/browser/web_contents/web_contents_impl.h" | 22 #include "content/browser/web_contents/web_contents_impl.h" |
24 #include "content/public/browser/power_save_blocker.h" | 23 #include "content/public/browser/power_save_blocker.h" |
25 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
26 #include "content/public/common/webplugininfo.h" | 25 #include "content/public/common/webplugininfo.h" |
27 #include "content/public/test/browser_test_utils.h" | 26 #include "content/public/test/browser_test_utils.h" |
28 #include "content/public/test/content_browser_test.h" | 27 #include "content/public/test/content_browser_test.h" |
29 #include "content/public/test/content_browser_test_utils.h" | 28 #include "content/public/test/content_browser_test_utils.h" |
30 #include "content/public/test/download_test_observer.h" | 29 #include "content/public/test/download_test_observer.h" |
31 #include "content/public/test/test_file_error_injector.h" | 30 #include "content/public/test/test_file_error_injector.h" |
32 #include "content/public/test/test_utils.h" | 31 #include "content/public/test/test_utils.h" |
33 #include "content/shell/browser/shell.h" | 32 #include "content/shell/browser/shell.h" |
34 #include "content/shell/browser/shell_browser_context.h" | 33 #include "content/shell/browser/shell_browser_context.h" |
35 #include "content/shell/browser/shell_download_manager_delegate.h" | 34 #include "content/shell/browser/shell_download_manager_delegate.h" |
36 #include "content/shell/browser/shell_network_delegate.h" | 35 #include "content/shell/browser/shell_network_delegate.h" |
37 #include "content/test/net/url_request_mock_http_job.h" | 36 #include "content/test/net/url_request_mock_http_job.h" |
38 #include "content/test/net/url_request_slow_download_job.h" | 37 #include "content/test/net/url_request_slow_download_job.h" |
39 #include "net/test/embedded_test_server/embedded_test_server.h" | 38 #include "net/test/embedded_test_server/embedded_test_server.h" |
40 #include "net/test/embedded_test_server/http_request.h" | 39 #include "net/test/embedded_test_server/http_request.h" |
41 #include "net/test/embedded_test_server/http_response.h" | 40 #include "net/test/embedded_test_server/http_response.h" |
42 #include "net/test/spawned_test_server/spawned_test_server.h" | 41 #include "net/test/spawned_test_server/spawned_test_server.h" |
43 #include "testing/gmock/include/gmock/gmock.h" | 42 #include "testing/gmock/include/gmock/gmock.h" |
44 #include "testing/gtest/include/gtest/gtest.h" | 43 #include "testing/gtest/include/gtest/gtest.h" |
45 #include "url/gurl.h" | 44 #include "url/gurl.h" |
46 | 45 |
| 46 #if defined(ENABLE_PLUGINS) |
| 47 #include "content/browser/plugin_service_impl.h" |
| 48 #endif |
| 49 |
47 using ::net::test_server::EmbeddedTestServer; | 50 using ::net::test_server::EmbeddedTestServer; |
48 using ::testing::AllOf; | 51 using ::testing::AllOf; |
49 using ::testing::Field; | 52 using ::testing::Field; |
50 using ::testing::InSequence; | 53 using ::testing::InSequence; |
51 using ::testing::Property; | 54 using ::testing::Property; |
52 using ::testing::Return; | 55 using ::testing::Return; |
53 using ::testing::StrictMock; | 56 using ::testing::StrictMock; |
54 using ::testing::_; | 57 using ::testing::_; |
55 | 58 |
56 namespace content { | 59 namespace content { |
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 ASSERT_TRUE(test_server.InitializeAndWaitUntilReady()); | 1808 ASSERT_TRUE(test_server.InitializeAndWaitUntilReady()); |
1806 | 1809 |
1807 GURL url = test_server.GetURL("/empty.bin"); | 1810 GURL url = test_server.GetURL("/empty.bin"); |
1808 test_server.ServeFilesFromDirectory(GetTestFilePath("download", "")); | 1811 test_server.ServeFilesFromDirectory(GetTestFilePath("download", "")); |
1809 | 1812 |
1810 NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); | 1813 NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); |
1811 // That's it. This should work without crashing. | 1814 // That's it. This should work without crashing. |
1812 } | 1815 } |
1813 | 1816 |
1814 } // namespace content | 1817 } // namespace content |
OLD | NEW |