Home | History | Annotate | Download | only in test
      1 // Copyright 2015 The Weave 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 LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_SERVER_H_
      6 #define LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_SERVER_H_
      7 
      8 #include <weave/provider/http_server.h>
      9 
     10 #include <string>
     11 #include <vector>
     12 
     13 #include <base/callback.h>
     14 
     15 namespace weave {
     16 namespace provider {
     17 namespace test {
     18 
     19 class MockHttpServer : public HttpServer {
     20  public:
     21   MOCK_METHOD2(AddHttpRequestHandler,
     22                void(const std::string&, const RequestHandlerCallback&));
     23   MOCK_METHOD2(AddHttpsRequestHandler,
     24                void(const std::string&, const RequestHandlerCallback&));
     25   MOCK_CONST_METHOD0(GetHttpPort, uint16_t());
     26   MOCK_CONST_METHOD0(GetHttpsPort, uint16_t());
     27   MOCK_CONST_METHOD0(GetHttpsCertificateFingerprint, std::vector<uint8_t>());
     28   MOCK_CONST_METHOD0(GetRequestTimeout, base::TimeDelta());
     29 };
     30 
     31 }  // namespace test
     32 }  // namespace provider
     33 }  // namespace weave
     34 
     35 #endif  // LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_SERVER_H_
     36