OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef MockThreadableLoader_h | 5 #ifndef MockThreadableLoader_h |
6 #define MockThreadableLoader_h | 6 #define MockThreadableLoader_h |
7 | 7 |
8 #include "core/loader/ThreadableLoader.h" | 8 #include "core/loader/ThreadableLoader.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "wtf/PtrUtil.h" | 10 #include "wtf/PtrUtil.h" |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class MockThreadableLoader : public ThreadableLoader { | 15 class MockThreadableLoader : public ThreadableLoader { |
16 public: | 16 public: |
17 static std::unique_ptr<MockThreadableLoader> create() { return wrapUnique(ne
w testing::StrictMock<MockThreadableLoader>); } | 17 static MockThreadableLoader* create() { return new testing::StrictMock<MockT
hreadableLoader>; } |
18 | 18 |
19 MOCK_METHOD1(start, void(const ResourceRequest&)); | 19 MOCK_METHOD1(start, void(const ResourceRequest&)); |
20 MOCK_METHOD1(overrideTimeout, void(unsigned long)); | 20 MOCK_METHOD1(overrideTimeout, void(unsigned long)); |
21 MOCK_METHOD0(cancel, void()); | 21 MOCK_METHOD0(cancel, void()); |
22 | 22 |
23 protected: | 23 protected: |
24 MockThreadableLoader() = default; | 24 MockThreadableLoader() = default; |
25 }; | 25 }; |
26 | 26 |
27 } // namespace blink | 27 } // namespace blink |
28 | 28 |
29 #endif // MockThreadableLoader_h | 29 #endif // MockThreadableLoader_h |
OLD | NEW |