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 "content/browser/download/mock_download_file.h" | 5 #include "content/browser/download/mock_download_file.h" |
6 | 6 |
7 using ::testing::_; | 7 using ::testing::_; |
8 using ::testing::Return; | 8 using ::testing::Return; |
9 | 9 |
| 10 namespace { |
| 11 |
| 12 void SuccessRun(content::DownloadFile::InitializeCallback callback) { |
| 13 callback.Run(content::DOWNLOAD_INTERRUPT_REASON_NONE); |
| 14 } |
| 15 |
| 16 } // namespace |
| 17 |
10 MockDownloadFile::MockDownloadFile() { | 18 MockDownloadFile::MockDownloadFile() { |
11 // This is here because |Initialize()| is normally called right after | 19 // This is here because |Initialize()| is normally called right after |
12 // construction. | 20 // construction. |
13 ON_CALL(*this, Initialize()) | 21 ON_CALL(*this, Initialize(_)) |
14 .WillByDefault(Return(content::DOWNLOAD_INTERRUPT_REASON_NONE)); | 22 .WillByDefault(::testing::Invoke(SuccessRun)); |
15 } | 23 } |
16 | 24 |
17 MockDownloadFile::~MockDownloadFile() { | 25 MockDownloadFile::~MockDownloadFile() { |
18 } | 26 } |
OLD | NEW |