Chromium Code Reviews| Index: chrome/browser/ui/webui/media_router/media_router_web_ui_test.h |
| diff --git a/chrome/browser/ui/webui/media_router/media_router_web_ui_test.h b/chrome/browser/ui/webui/media_router/media_router_web_ui_test.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a71bb5381b7b3ef859e0f2964655b82a0c5727f8 |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/media_router/media_router_web_ui_test.h |
| @@ -0,0 +1,67 @@ |
| +// Copyright 2015 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_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEB_UI_TEST_H_ |
| +#define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEB_UI_TEST_H_ |
| + |
| +#include "base/macros.h" |
| +#include "chrome/browser/media/router/media_router_ui_service.h" |
| +#include "chrome/test/base/browser_with_test_window_test.h" |
| +#include "extensions/common/feature_switch.h" |
| +#include "testing/gmock/include/gmock/gmock.h" |
| + |
| +class BrowserWindow; |
| +class TestingProfile; |
| + |
| +class MockMediaRouterActionController : public MediaRouterActionController { |
| + public: |
| + explicit MockMediaRouterActionController(Profile* profile); |
| + ~MockMediaRouterActionController() override; |
| + |
| + MOCK_METHOD1(OnIssueUpdated, void(const media_router::Issue* issue)); |
| + MOCK_METHOD2(OnRoutesUpdated, |
| + void(const std::vector<media_router::MediaRoute>& routes, |
| + const std::vector<media_router::MediaRoute::Id>& |
| + joinable_route_ids)); |
| + MOCK_METHOD0(OnDialogShown, void()); |
| + MOCK_METHOD0(OnDialogHidden, void()); |
| + MOCK_METHOD0(MaybeAddOrRemoveAction, void()); |
| +}; |
| + |
| +class MockMediaRouterUIService : public media_router::MediaRouterUIService { |
| + public: |
| + explicit MockMediaRouterUIService(Profile* profile); |
| + ~MockMediaRouterUIService() override; |
| + |
| + MediaRouterActionController* action_controller() const override; |
| + |
| + private: |
| + std::unique_ptr<MediaRouterActionController> action_controller_; |
| +}; |
| + |
| +class MediaRouterWebUITest : public BrowserWithTestWindowTest { |
| + public: |
| + // |require_mock_ui_service_| defaults to false in the default ctor. |
| + MediaRouterWebUITest(); |
| + explicit MediaRouterWebUITest(bool require_mock_ui_service); |
| + ~MediaRouterWebUITest() override; |
| + |
| + // BrowserWithTestWindowTest: |
| + TestingProfile* CreateProfile() override; |
| + |
| + protected: |
| + // BrowserWithTestWindowTest override. |
| + BrowserWindow* CreateBrowserWindow() override; |
| + |
| + private: |
| + extensions::FeatureSwitch::ScopedOverride feature_override_; |
|
mark a. foltz
2016/11/01 02:00:09
This should no longer be necessary, as Media Route
takumif
2016/11/02 03:16:54
Removed.
|
| + |
| + // When this is set to true, MockMediaRouterUIService is instantiated. |
| + // Otherwise, no MediaRouterUIService is instantiated. |
| + bool require_mock_ui_service_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUITest); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEB_UI_TEST_H_ |