| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/browser/ui/browser.h" | 49 #include "chrome/browser/ui/browser.h" |
| 50 #include "chrome/browser/ui/browser_commands.h" | 50 #include "chrome/browser/ui/browser_commands.h" |
| 51 #include "chrome/browser/ui/browser_finder.h" | 51 #include "chrome/browser/ui/browser_finder.h" |
| 52 #include "chrome/browser/ui/browser_list.h" | 52 #include "chrome/browser/ui/browser_list.h" |
| 53 #include "chrome/browser/ui/browser_tabstrip.h" | 53 #include "chrome/browser/ui/browser_tabstrip.h" |
| 54 #include "chrome/browser/ui/browser_window.h" | 54 #include "chrome/browser/ui/browser_window.h" |
| 55 #include "chrome/browser/ui/chrome_pages.h" | 55 #include "chrome/browser/ui/chrome_pages.h" |
| 56 #include "chrome/browser/ui/host_desktop.h" | 56 #include "chrome/browser/ui/host_desktop.h" |
| 57 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 57 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 58 #include "chrome/common/chrome_paths.h" | 58 #include "chrome/common/chrome_paths.h" |
| 59 #include "chrome/common/extensions/feature_switch.h" | |
| 60 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
| 61 #include "chrome/common/url_constants.h" | 60 #include "chrome/common/url_constants.h" |
| 62 #include "chrome/test/base/in_process_browser_test.h" | 61 #include "chrome/test/base/in_process_browser_test.h" |
| 63 #include "chrome/test/base/test_switches.h" | 62 #include "chrome/test/base/test_switches.h" |
| 64 #include "chrome/test/base/ui_test_utils.h" | 63 #include "chrome/test/base/ui_test_utils.h" |
| 65 #include "content/public/browser/download_item.h" | 64 #include "content/public/browser/download_item.h" |
| 66 #include "content/public/browser/download_manager.h" | 65 #include "content/public/browser/download_manager.h" |
| 67 #include "content/public/browser/download_save_info.h" | 66 #include "content/public/browser/download_save_info.h" |
| 68 #include "content/public/browser/download_url_parameters.h" | 67 #include "content/public/browser/download_url_parameters.h" |
| 69 #include "content/public/browser/notification_source.h" | 68 #include "content/public/browser/notification_source.h" |
| 70 #include "content/public/browser/render_view_host.h" | 69 #include "content/public/browser/render_view_host.h" |
| 71 #include "content/public/browser/resource_context.h" | 70 #include "content/public/browser/resource_context.h" |
| 72 #include "content/public/browser/web_contents.h" | 71 #include "content/public/browser/web_contents.h" |
| 73 #include "content/public/common/content_switches.h" | 72 #include "content/public/common/content_switches.h" |
| 74 #include "content/public/common/context_menu_params.h" | 73 #include "content/public/common/context_menu_params.h" |
| 75 #include "content/public/common/page_transition_types.h" | 74 #include "content/public/common/page_transition_types.h" |
| 76 #include "content/public/test/browser_test_utils.h" | 75 #include "content/public/test/browser_test_utils.h" |
| 77 #include "content/public/test/download_test_observer.h" | 76 #include "content/public/test/download_test_observer.h" |
| 78 #include "content/public/test/test_file_error_injector.h" | 77 #include "content/public/test/test_file_error_injector.h" |
| 79 #include "content/public/test/test_navigation_observer.h" | 78 #include "content/public/test/test_navigation_observer.h" |
| 80 #include "content/test/net/url_request_mock_http_job.h" | 79 #include "content/test/net/url_request_mock_http_job.h" |
| 81 #include "content/test/net/url_request_slow_download_job.h" | 80 #include "content/test/net/url_request_slow_download_job.h" |
| 81 #include "extensions/common/feature_switch.h" |
| 82 #include "grit/generated_resources.h" | 82 #include "grit/generated_resources.h" |
| 83 #include "net/base/net_util.h" | 83 #include "net/base/net_util.h" |
| 84 #include "net/test/spawned_test_server/spawned_test_server.h" | 84 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 85 #include "testing/gtest/include/gtest/gtest.h" | 85 #include "testing/gtest/include/gtest/gtest.h" |
| 86 #include "ui/base/l10n/l10n_util.h" | 86 #include "ui/base/l10n/l10n_util.h" |
| 87 | 87 |
| 88 using content::BrowserContext; | 88 using content::BrowserContext; |
| 89 using content::BrowserThread; | 89 using content::BrowserThread; |
| 90 using content::DownloadItem; | 90 using content::DownloadItem; |
| 91 using content::DownloadManager; | 91 using content::DownloadManager; |
| (...skipping 3151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3243 | 3243 |
| 3244 // No errors this time. The download should complete successfully. | 3244 // No errors this time. The download should complete successfully. |
| 3245 EXPECT_FALSE(completion_observer->IsFinished()); | 3245 EXPECT_FALSE(completion_observer->IsFinished()); |
| 3246 completion_observer->StartObserving(); | 3246 completion_observer->StartObserving(); |
| 3247 download->Resume(); | 3247 download->Resume(); |
| 3248 completion_observer->WaitForFinished(); | 3248 completion_observer->WaitForFinished(); |
| 3249 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState()); | 3249 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState()); |
| 3250 | 3250 |
| 3251 EXPECT_FALSE(DidShowFileChooser()); | 3251 EXPECT_FALSE(DidShowFileChooser()); |
| 3252 } | 3252 } |
| OLD | NEW |