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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_web_ui_test.h

Issue 2410553002: Show Media Router toolbar icon ephemerally for MR dialogs (Closed)
Patch Set: Address Mark's comments Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium 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 CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEB_UI_TEST_H_
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEB_UI_TEST_H_
7
8 #include "base/macros.h"
9 #include "chrome/browser/media/router/media_router_ui_service.h"
10 #include "chrome/test/base/browser_with_test_window_test.h"
11 #include "extensions/common/feature_switch.h"
12 #include "testing/gmock/include/gmock/gmock.h"
13
14 class BrowserWindow;
15 class TestingProfile;
16
17 class MockMediaRouterActionController : public MediaRouterActionController {
18 public:
19 explicit MockMediaRouterActionController(Profile* profile);
20 ~MockMediaRouterActionController() override;
21
22 MOCK_METHOD1(OnIssueUpdated, void(const media_router::Issue* issue));
23 MOCK_METHOD2(OnRoutesUpdated,
24 void(const std::vector<media_router::MediaRoute>& routes,
25 const std::vector<media_router::MediaRoute::Id>&
26 joinable_route_ids));
27 MOCK_METHOD0(OnDialogShown, void());
28 MOCK_METHOD0(OnDialogHidden, void());
29 MOCK_METHOD0(MaybeAddOrRemoveAction, void());
30 };
31
32 class MockMediaRouterUIService : public media_router::MediaRouterUIService {
33 public:
34 explicit MockMediaRouterUIService(Profile* profile);
35 ~MockMediaRouterUIService() override;
36
37 MediaRouterActionController* action_controller() const override;
38
39 private:
40 std::unique_ptr<MediaRouterActionController> action_controller_;
41 };
42
43 class MediaRouterWebUITest : public BrowserWithTestWindowTest {
44 public:
45 // |require_mock_ui_service_| defaults to false in the default ctor.
46 MediaRouterWebUITest();
47 explicit MediaRouterWebUITest(bool require_mock_ui_service);
48 ~MediaRouterWebUITest() override;
49
50 // BrowserWithTestWindowTest:
51 TestingProfile* CreateProfile() override;
52
53 protected:
54 // BrowserWithTestWindowTest override.
55 BrowserWindow* CreateBrowserWindow() override;
56
57 private:
58 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.
59
60 // When this is set to true, MockMediaRouterUIService is instantiated.
61 // Otherwise, no MediaRouterUIService is instantiated.
62 bool require_mock_ui_service_;
63
64 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUITest);
65 };
66
67 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEB_UI_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698