1 // Copyright 2014 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef LIBBRILLO_BRILLO_HTTP_MOCK_TRANSPORT_H_ 6 #define LIBBRILLO_BRILLO_HTTP_MOCK_TRANSPORT_H_ 7 8 #include <memory> 9 #include <string> 10 11 #include <base/macros.h> 12 #include <brillo/http/http_transport.h> 13 #include <gmock/gmock.h> 14 15 namespace brillo { 16 namespace http { 17 18 class MockTransport : public Transport { 19 public: 20 MockTransport() = default; 21 22 MOCK_METHOD6(CreateConnection, 23 std::shared_ptr<Connection>(const std::string&, 24 const std::string&, 25 const HeaderList&, 26 const std::string&, 27 const std::string&, 28 brillo::ErrorPtr*)); 29 MOCK_METHOD2(RunCallbackAsync, 30 void(const tracked_objects::Location&, const base::Closure&)); 31 MOCK_METHOD3(StartAsyncTransfer, RequestID(Connection*, 32 const SuccessCallback&, 33 const ErrorCallback&)); 34 MOCK_METHOD1(CancelRequest, bool(RequestID)); 35 MOCK_METHOD1(SetDefaultTimeout, void(base::TimeDelta)); 36 37 private: 38 DISALLOW_COPY_AND_ASSIGN(MockTransport); 39 }; 40 41 } // namespace http 42 } // namespace brillo 43 44 #endif // LIBBRILLO_BRILLO_HTTP_MOCK_TRANSPORT_H_ 45