Chromium Code Reviews| 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/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "content/browser/byte_stream.h" | 10 #include "content/browser/byte_stream.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 MOCK_METHOD1(ShouldOpenFileBasedOnExtension, bool(const base::FilePath&)); | 53 MOCK_METHOD1(ShouldOpenFileBasedOnExtension, bool(const base::FilePath&)); |
| 54 MOCK_METHOD1(CheckForFileRemoval, void(DownloadItemImpl*)); | 54 MOCK_METHOD1(CheckForFileRemoval, void(DownloadItemImpl*)); |
| 55 | 55 |
| 56 void ResumeInterruptedDownload( | 56 void ResumeInterruptedDownload( |
| 57 scoped_ptr<DownloadUrlParameters> params, uint32 id) override { | 57 scoped_ptr<DownloadUrlParameters> params, uint32 id) override { |
| 58 MockResumeInterruptedDownload(params.get(), id); | 58 MockResumeInterruptedDownload(params.get(), id); |
| 59 } | 59 } |
| 60 MOCK_METHOD2(MockResumeInterruptedDownload, | 60 MOCK_METHOD2(MockResumeInterruptedDownload, |
| 61 void(DownloadUrlParameters* params, uint32 id)); | 61 void(DownloadUrlParameters* params, uint32 id)); |
| 62 | 62 |
| 63 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); | 63 BrowserContext* GetBrowserContext() const override { |
| 64 return NULL; | |
|
asanka
2015/11/25 15:53:57
Nit: nullptr for new code.
svaldez
2015/11/25 17:53:28
Done.
| |
| 65 } | |
| 64 MOCK_METHOD1(UpdatePersistence, void(DownloadItemImpl*)); | 66 MOCK_METHOD1(UpdatePersistence, void(DownloadItemImpl*)); |
| 65 MOCK_METHOD1(DownloadOpened, void(DownloadItemImpl*)); | 67 MOCK_METHOD1(DownloadOpened, void(DownloadItemImpl*)); |
| 66 MOCK_METHOD1(DownloadRemoved, void(DownloadItemImpl*)); | 68 MOCK_METHOD1(DownloadRemoved, void(DownloadItemImpl*)); |
| 67 MOCK_CONST_METHOD1(AssertStateConsistent, void(DownloadItemImpl*)); | 69 MOCK_CONST_METHOD1(AssertStateConsistent, void(DownloadItemImpl*)); |
| 68 | 70 |
| 69 void VerifyAndClearExpectations() { | 71 void VerifyAndClearExpectations() { |
| 70 ::testing::Mock::VerifyAndClearExpectations(this); | 72 ::testing::Mock::VerifyAndClearExpectations(this); |
| 71 SetDefaultExpectations(); | 73 SetDefaultExpectations(); |
| 72 } | 74 } |
| 73 | 75 |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1292 base::Unretained(&returned_path))); | 1294 base::Unretained(&returned_path))); |
| 1293 RunAllPendingInMessageLoops(); | 1295 RunAllPendingInMessageLoops(); |
| 1294 EXPECT_TRUE(returned_path.empty()); | 1296 EXPECT_TRUE(returned_path.empty()); |
| 1295 } | 1297 } |
| 1296 | 1298 |
| 1297 TEST(MockDownloadItem, Compiles) { | 1299 TEST(MockDownloadItem, Compiles) { |
| 1298 MockDownloadItem mock_item; | 1300 MockDownloadItem mock_item; |
| 1299 } | 1301 } |
| 1300 | 1302 |
| 1301 } // namespace content | 1303 } // namespace content |
| OLD | NEW |