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 "content/browser/byte_stream.h" | 14 #include "content/browser/byte_stream.h" |
15 #include "content/browser/download/download_file_factory.h" | 15 #include "content/browser/download/download_file_factory.h" |
16 #include "content/browser/download/download_file_impl.h" | 16 #include "content/browser/download/download_file_impl.h" |
17 #include "content/browser/download/download_item_impl.h" | 17 #include "content/browser/download/download_item_impl.h" |
18 #include "content/browser/download/download_manager_impl.h" | 18 #include "content/browser/download/download_manager_impl.h" |
19 #include "content/browser/download/download_resource_handler.h" | 19 #include "content/browser/download/download_resource_handler.h" |
20 #include "content/browser/plugin_service_impl.h" | 20 #include "content/browser/plugin_service_impl.h" |
21 #include "content/browser/web_contents/web_contents_impl.h" | 21 #include "content/browser/web_contents/web_contents_impl.h" |
22 #include "content/public/browser/power_save_blocker.h" | 22 #include "content/public/browser/power_save_blocker.h" |
23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
24 #include "content/public/common/webplugininfo.h" | 24 #include "content/public/common/webplugininfo.h" |
25 #include "content/public/test/browser_test_utils.h" | 25 #include "content/public/test/browser_test_utils.h" |
26 #include "content/public/test/download_test_observer.h" | 26 #include "content/public/test/download_test_observer.h" |
27 #include "content/public/test/test_file_error_injector.h" | 27 #include "content/public/test/test_file_error_injector.h" |
28 #include "content/public/test/test_utils.h" | 28 #include "content/public/test/test_utils.h" |
29 #include "content/shell/shell.h" | 29 #include "content/shell/browser/shell.h" |
30 #include "content/shell/shell_browser_context.h" | 30 #include "content/shell/browser/shell_browser_context.h" |
31 #include "content/shell/shell_download_manager_delegate.h" | 31 #include "content/shell/browser/shell_download_manager_delegate.h" |
32 #include "content/shell/shell_network_delegate.h" | 32 #include "content/shell/browser/shell_network_delegate.h" |
33 #include "content/test/content_browser_test.h" | 33 #include "content/test/content_browser_test.h" |
34 #include "content/test/content_browser_test_utils.h" | 34 #include "content/test/content_browser_test_utils.h" |
35 #include "content/test/net/url_request_mock_http_job.h" | 35 #include "content/test/net/url_request_mock_http_job.h" |
36 #include "content/test/net/url_request_slow_download_job.h" | 36 #include "content/test/net/url_request_slow_download_job.h" |
37 #include "net/test/spawned_test_server/spawned_test_server.h" | 37 #include "net/test/spawned_test_server/spawned_test_server.h" |
38 #include "testing/gmock/include/gmock/gmock.h" | 38 #include "testing/gmock/include/gmock/gmock.h" |
39 #include "testing/gtest/include/gtest/gtest.h" | 39 #include "testing/gtest/include/gtest/gtest.h" |
40 #include "url/gurl.h" | 40 #include "url/gurl.h" |
41 | 41 |
42 using ::testing::_; | 42 using ::testing::_; |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 ASSERT_EQ(1u, downloads.size()); | 1632 ASSERT_EQ(1u, downloads.size()); |
1633 ASSERT_EQ(DownloadItem::COMPLETE, downloads[0]->GetState()); | 1633 ASSERT_EQ(DownloadItem::COMPLETE, downloads[0]->GetState()); |
1634 | 1634 |
1635 // Check that the cookies were correctly set. | 1635 // Check that the cookies were correctly set. |
1636 EXPECT_EQ("A=B", | 1636 EXPECT_EQ("A=B", |
1637 content::GetCookies(shell()->web_contents()->GetBrowserContext(), | 1637 content::GetCookies(shell()->web_contents()->GetBrowserContext(), |
1638 GURL(download))); | 1638 GURL(download))); |
1639 } | 1639 } |
1640 | 1640 |
1641 } // namespace content | 1641 } // namespace content |
OLD | NEW |