Index: chrome/browser/media/router/mock_device_description_service.h |
diff --git a/chrome/browser/media/router/mock_device_description_service.h b/chrome/browser/media/router/mock_device_description_service.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bbb0901ad9708fb120b887e685a78636fcefb364 |
--- /dev/null |
+++ b/chrome/browser/media/router/mock_device_description_service.h |
@@ -0,0 +1,51 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_MOCK_DEVICE_DESCRIPTION_SERVICE_H_ |
+#define CHROME_BROWSER_MEDIA_ROUTER_MOCK_DEVICE_DESCRIPTION_SERVICE_H_ |
+ |
+#include "chrome/browser/media/router/device_description_service.h" |
+#include "testing/gmock/include/gmock/gmock.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace media_router { |
+ |
+class MockDeviceDescriptionServiceObserver |
+ : public DeviceDescriptionService::Observer { |
+ public: |
+ MockDeviceDescriptionServiceObserver(); |
+ ~MockDeviceDescriptionServiceObserver() override; |
+ |
+ MOCK_METHOD2(OnDeviceDescriptionAvailable, |
+ void(const std::string& device_id, |
+ const DialDeviceDescription& description)); |
+ |
+ MOCK_METHOD2(OnDeviceDescriptionFetchError, |
+ void(const std::string& device_id, |
+ const std::string& error_message)); |
+}; |
+ |
+class MockDeviceDescriptionService : public DeviceDescriptionService { |
+ public: |
+ explicit MockDeviceDescriptionService( |
+ DeviceDescriptionService::Observer* observer); |
+ ~MockDeviceDescriptionService() override; |
+ |
+ MOCK_METHOD3(GetDeviceDescription, |
+ bool(const DialDeviceData& device, |
+ net::URLRequestContextGetter* request_context, |
+ DialDeviceDescription* out_description)); |
+ |
+ MOCK_METHOD1(MayStopDeviceDescriptionFetching, |
+ bool(const std::string& device_label)); |
+ |
+ MOCK_METHOD3(CheckAccess, |
+ void(const GURL& device_description_url, |
+ net::URLRequestContextGetter* request_context, |
+ const CheckAccessCallback& check_access_cb)); |
+}; |
+ |
+} // namespace media_router |
+ |
+#endif // CHROME_BROWSER_MEDIA_ROUTER_MOCK_DEVICE_DESCRIPTION_SERVICE_H_ |