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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(MockDownloadsDOMHandler); | 110 DISALLOW_COPY_AND_ASSIGN(MockDownloadsDOMHandler); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace | 113 } // namespace |
114 | 114 |
115 class DownloadsDOMHandlerTest : public InProcessBrowserTest { | 115 class DownloadsDOMHandlerTest : public InProcessBrowserTest { |
116 public: | 116 public: |
117 DownloadsDOMHandlerTest() {} | 117 DownloadsDOMHandlerTest() {} |
118 | 118 |
119 virtual ~DownloadsDOMHandlerTest() {} | 119 ~DownloadsDOMHandlerTest() override {} |
120 | 120 |
121 void SetUpOnMainThread() override { | 121 void SetUpOnMainThread() override { |
122 mock_handler_.reset(new MockDownloadsDOMHandler(download_manager())); | 122 mock_handler_.reset(new MockDownloadsDOMHandler(download_manager())); |
123 CHECK(downloads_directory_.CreateUniqueTempDir()); | 123 CHECK(downloads_directory_.CreateUniqueTempDir()); |
124 browser()->profile()->GetPrefs()->SetFilePath( | 124 browser()->profile()->GetPrefs()->SetFilePath( |
125 prefs::kDownloadDefaultDirectory, | 125 prefs::kDownloadDefaultDirectory, |
126 downloads_directory_.path()); | 126 downloads_directory_.path()); |
127 CHECK(test_server()->Start()); | 127 CHECK(test_server()->Start()); |
128 } | 128 } |
129 | 129 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // TODO(benjhayden): Test incognito, both downloads_list() and that on-record | 248 // TODO(benjhayden): Test incognito, both downloads_list() and that on-record |
249 // calls can't access off-record items. | 249 // calls can't access off-record items. |
250 | 250 |
251 // TODO(benjhayden): Test that bad download ids incoming from the javascript are | 251 // TODO(benjhayden): Test that bad download ids incoming from the javascript are |
252 // dropped on the floor. | 252 // dropped on the floor. |
253 | 253 |
254 // TODO(benjhayden): Test that IsTemporary() downloads are not shown. | 254 // TODO(benjhayden): Test that IsTemporary() downloads are not shown. |
255 | 255 |
256 // TODO(benjhayden): Test that RemoveObserver is called on all download items, | 256 // TODO(benjhayden): Test that RemoveObserver is called on all download items, |
257 // including items that crossed IsTemporary() and back. | 257 // including items that crossed IsTemporary() and back. |
OLD | NEW |