| 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" | 22 #include "content/browser/plugin_service_impl.h" |
| 23 #include "content/browser/web_contents/web_contents_impl.h" | 23 #include "content/browser/web_contents/web_contents_impl.h" |
| 24 #include "content/public/browser/power_save_blocker.h" | 24 #include "content/public/browser/power_save_blocker.h" |
| 25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
| 26 #include "content/public/common/webplugininfo.h" | 26 #include "content/public/common/webplugininfo.h" |
| 27 #include "content/public/test/browser_test_utils.h" | 27 #include "content/public/test/browser_test_utils.h" |
| 28 #include "content/public/test/content_browser_test.h" |
| 29 #include "content/public/test/content_browser_test_utils.h" |
| 28 #include "content/public/test/download_test_observer.h" | 30 #include "content/public/test/download_test_observer.h" |
| 29 #include "content/public/test/test_file_error_injector.h" | 31 #include "content/public/test/test_file_error_injector.h" |
| 30 #include "content/public/test/test_utils.h" | 32 #include "content/public/test/test_utils.h" |
| 31 #include "content/shell/browser/shell.h" | 33 #include "content/shell/browser/shell.h" |
| 32 #include "content/shell/browser/shell_browser_context.h" | 34 #include "content/shell/browser/shell_browser_context.h" |
| 33 #include "content/shell/browser/shell_download_manager_delegate.h" | 35 #include "content/shell/browser/shell_download_manager_delegate.h" |
| 34 #include "content/shell/browser/shell_network_delegate.h" | 36 #include "content/shell/browser/shell_network_delegate.h" |
| 35 #include "content/test/content_browser_test.h" | |
| 36 #include "content/test/content_browser_test_utils.h" | |
| 37 #include "content/test/net/url_request_mock_http_job.h" | 37 #include "content/test/net/url_request_mock_http_job.h" |
| 38 #include "content/test/net/url_request_slow_download_job.h" | 38 #include "content/test/net/url_request_slow_download_job.h" |
| 39 #include "net/test/spawned_test_server/spawned_test_server.h" | 39 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 40 #include "testing/gmock/include/gmock/gmock.h" | 40 #include "testing/gmock/include/gmock/gmock.h" |
| 41 #include "testing/gtest/include/gtest/gtest.h" | 41 #include "testing/gtest/include/gtest/gtest.h" |
| 42 #include "url/gurl.h" | 42 #include "url/gurl.h" |
| 43 | 43 |
| 44 using ::testing::_; | 44 using ::testing::_; |
| 45 using ::testing::AllOf; | 45 using ::testing::AllOf; |
| 46 using ::testing::Field; | 46 using ::testing::Field; |
| (...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 ASSERT_EQ(1u, downloads.size()); | 1647 ASSERT_EQ(1u, downloads.size()); |
| 1648 ASSERT_EQ(DownloadItem::COMPLETE, downloads[0]->GetState()); | 1648 ASSERT_EQ(DownloadItem::COMPLETE, downloads[0]->GetState()); |
| 1649 | 1649 |
| 1650 // Check that the cookies were correctly set. | 1650 // Check that the cookies were correctly set. |
| 1651 EXPECT_EQ("A=B", | 1651 EXPECT_EQ("A=B", |
| 1652 content::GetCookies(shell()->web_contents()->GetBrowserContext(), | 1652 content::GetCookies(shell()->web_contents()->GetBrowserContext(), |
| 1653 GURL(download))); | 1653 GURL(download))); |
| 1654 } | 1654 } |
| 1655 | 1655 |
| 1656 } // namespace content | 1656 } // namespace content |
| OLD | NEW |