OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/test/test_file_util.h" | 10 #include "base/test/test_file_util.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/download/download_file_manager.h" | 13 #include "chrome/browser/download/download_file_manager.h" |
14 #include "chrome/browser/download/download_item.h" | 14 #include "chrome/browser/download/download_item.h" |
15 #include "chrome/browser/download/download_manager.h" | 15 #include "chrome/browser/download/download_manager.h" |
16 #include "chrome/browser/download/download_prefs.h" | 16 #include "chrome/browser/download/download_prefs.h" |
17 #include "chrome/browser/download/download_shelf.h" | 17 #include "chrome/browser/download/download_shelf.h" |
18 #include "chrome/browser/history/download_history_info.h" | 18 #include "chrome/browser/history/download_history_info.h" |
19 #include "chrome/browser/history/history.h" | 19 #include "chrome/browser/history/history.h" |
20 #include "chrome/browser/net/url_request_mock_http_job.h" | |
21 #include "chrome/browser/net/url_request_slow_download_job.h" | |
22 #include "chrome/browser/prefs/pref_service.h" | 20 #include "chrome/browser/prefs/pref_service.h" |
23 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
25 #include "chrome/browser/ui/browser_list.h" | 23 #include "chrome/browser/ui/browser_list.h" |
26 #include "chrome/browser/ui/browser_window.h" | 24 #include "chrome/browser/ui/browser_window.h" |
27 #include "chrome/browser/ui/webui/active_downloads_ui.h" | 25 #include "chrome/browser/ui/webui/active_downloads_ui.h" |
28 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
29 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
30 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
31 #include "chrome/test/in_process_browser_test.h" | 29 #include "chrome/test/in_process_browser_test.h" |
32 #include "chrome/test/ui_test_utils.h" | 30 #include "chrome/test/ui_test_utils.h" |
33 #include "content/browser/cancelable_request.h" | 31 #include "content/browser/cancelable_request.h" |
| 32 #include "content/browser/net/url_request_mock_http_job.h" |
34 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 33 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
35 #include "content/browser/tab_contents/tab_contents.h" | 34 #include "content/browser/tab_contents/tab_contents.h" |
| 35 #include "content/browser/net/url_request_slow_download_job.h" |
36 #include "content/common/page_transition_types.h" | 36 #include "content/common/page_transition_types.h" |
37 #include "net/base/net_util.h" | 37 #include "net/base/net_util.h" |
38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
42 // Construction of this class defines a system state, based on some number | 42 // Construction of this class defines a system state, based on some number |
43 // of downloads being seen in a particular state + other events that | 43 // of downloads being seen in a particular state + other events that |
44 // may occur in the download system. That state will be recorded if it | 44 // may occur in the download system. That state will be recorded if it |
45 // occurs at any point after construction. When that state occurs, the class | 45 // occurs at any point after construction. When that state occurs, the class |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 EXPECT_EQ(DownloadItem::COMPLETE, downloads[0]->state()); | 1404 EXPECT_EQ(DownloadItem::COMPLETE, downloads[0]->state()); |
1405 EXPECT_TRUE(downloads[0]->opened()); | 1405 EXPECT_TRUE(downloads[0]->opened()); |
1406 | 1406 |
1407 // As long as we're here, confirmed everything else is good. | 1407 // As long as we're here, confirmed everything else is good. |
1408 EXPECT_EQ(1, browser()->tab_count()); | 1408 EXPECT_EQ(1, browser()->tab_count()); |
1409 CheckDownload(browser(), file, file); | 1409 CheckDownload(browser(), file, file); |
1410 // Dissapears on most UIs, but the download panel sticks around for | 1410 // Dissapears on most UIs, but the download panel sticks around for |
1411 // chrome os. | 1411 // chrome os. |
1412 CheckDownloadUIVisible(browser(), false, true); | 1412 CheckDownloadUIVisible(browser(), false, true); |
1413 } | 1413 } |
OLD | NEW |