| 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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/history/download_row.h" | 10 #include "chrome/browser/history/download_row.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 MockDownloadsDOMHandler mddh(download_manager()); | 140 MockDownloadsDOMHandler mddh(download_manager()); |
| 141 | 141 |
| 142 GURL url = test_server()->GetURL("files/downloads/image.jpg"); | 142 GURL url = test_server()->GetURL("files/downloads/image.jpg"); |
| 143 std::vector<GURL> url_chain; | 143 std::vector<GURL> url_chain; |
| 144 url_chain.push_back(url); | 144 url_chain.push_back(url); |
| 145 base::Time current(base::Time::Now()); | 145 base::Time current(base::Time::Now()); |
| 146 download_manager()->CreateDownloadItem( | 146 download_manager()->CreateDownloadItem( |
| 147 base::FilePath(FILE_PATH_LITERAL("/path/to/file")), | 147 base::FilePath(FILE_PATH_LITERAL("/path/to/file")), |
| 148 base::FilePath(FILE_PATH_LITERAL("/path/to/file")), | 148 base::FilePath(FILE_PATH_LITERAL("/path/to/file")), |
| 149 url_chain, | 149 url_chain, |
| 150 GURL(""), | 150 GURL(std::string()), |
| 151 current, | 151 current, |
| 152 current, | 152 current, |
| 153 128, | 153 128, |
| 154 128, | 154 128, |
| 155 content::DownloadItem::COMPLETE, | 155 content::DownloadItem::COMPLETE, |
| 156 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, | 156 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, |
| 157 content::DOWNLOAD_INTERRUPT_REASON_NONE, | 157 content::DOWNLOAD_INTERRUPT_REASON_NONE, |
| 158 false); | 158 false); |
| 159 | 159 |
| 160 mddh.WaitForDownloadsList(); | 160 mddh.WaitForDownloadsList(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 188 // TODO(benjhayden): Test incognito, both downloads_list() and that on-record | 188 // TODO(benjhayden): Test incognito, both downloads_list() and that on-record |
| 189 // calls can't access off-record items. | 189 // calls can't access off-record items. |
| 190 | 190 |
| 191 // TODO(benjhayden): Test that bad download ids incoming from the javascript are | 191 // TODO(benjhayden): Test that bad download ids incoming from the javascript are |
| 192 // dropped on the floor. | 192 // dropped on the floor. |
| 193 | 193 |
| 194 // TODO(benjhayden): Test that IsTemporary() downloads are not shown. | 194 // TODO(benjhayden): Test that IsTemporary() downloads are not shown. |
| 195 | 195 |
| 196 // TODO(benjhayden): Test that RemoveObserver is called on all download items, | 196 // TODO(benjhayden): Test that RemoveObserver is called on all download items, |
| 197 // including items that crossed IsTemporary() and back. | 197 // including items that crossed IsTemporary() and back. |
| OLD | NEW |