Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1819)

Unified Diff: chrome/browser/media/router/mock_device_description_service.h

Issue 2701633002: [Media Router] Add DialMediaSinkService and DeviceDescriptionService (Closed)
Patch Set: Add DialMediaSinkCacheService and unit test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698