| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 scoped_ptr<std::vector<history::DownloadRow> > history_downloads; | 302 scoped_ptr<std::vector<history::DownloadRow> > history_downloads; |
| 303 history_downloads.reset(new std::vector<history::DownloadRow>()); | 303 history_downloads.reset(new std::vector<history::DownloadRow>()); |
| 304 history_downloads->push_back(history::DownloadRow()); | 304 history_downloads->push_back(history::DownloadRow()); |
| 305 history_downloads->front().id = 1; | 305 history_downloads->front().id = 1; |
| 306 | 306 |
| 307 std::vector<GURL> url_chain; | 307 std::vector<GURL> url_chain; |
| 308 GURL url; | 308 GURL url; |
| 309 scoped_ptr<MockDownloadItem> item = CreateMockInProgressDownload(); | 309 scoped_ptr<MockDownloadItem> item = CreateMockInProgressDownload(); |
| 310 | 310 |
| 311 EXPECT_CALL(*item, GetOriginalMimeType()); |
| 311 EXPECT_CALL(*manager(), CheckForHistoryFilesRemoval()); | 312 EXPECT_CALL(*manager(), CheckForHistoryFilesRemoval()); |
| 312 | 313 |
| 313 { | 314 { |
| 314 testing::InSequence s; | 315 testing::InSequence s; |
| 315 testing::MockFunction<void()> mock_function; | 316 testing::MockFunction<void()> mock_function; |
| 316 // DownloadHistory will immediately try to create a download using the info | 317 // DownloadHistory will immediately try to create a download using the info |
| 317 // we push through the query callback. When DownloadManager::CreateDownload | 318 // we push through the query callback. When DownloadManager::CreateDownload |
| 318 // is called, we need to first invoke the OnDownloadCreated callback for | 319 // is called, we need to first invoke the OnDownloadCreated callback for |
| 319 // DownloadHistory before returning the DownloadItem since that's the | 320 // DownloadHistory before returning the DownloadItem since that's the |
| 320 // sequence of events expected by DownloadHistory. | 321 // sequence of events expected by DownloadHistory. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 337 // DownloadUIController. It should ignore the download since it's marked as | 338 // DownloadUIController. It should ignore the download since it's marked as |
| 338 // being restored from history. | 339 // being restored from history. |
| 339 ASSERT_TRUE(manager_observer()); | 340 ASSERT_TRUE(manager_observer()); |
| 340 manager_observer()->OnDownloadCreated(manager(), item.get()); | 341 manager_observer()->OnDownloadCreated(manager(), item.get()); |
| 341 | 342 |
| 342 // Finally, the expectation we've been waiting for: | 343 // Finally, the expectation we've been waiting for: |
| 343 EXPECT_FALSE(notified_item()); | 344 EXPECT_FALSE(notified_item()); |
| 344 } | 345 } |
| 345 | 346 |
| 346 } // namespace | 347 } // namespace |
| OLD | NEW |