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

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 Mike and 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 2016 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 "testing/gmock/include/gmock/gmock.h"
12
13 class MockMediaRouterActionController : public MediaRouterActionController {
14 public:
15 explicit MockMediaRouterActionController(Profile* profile);
16 ~MockMediaRouterActionController() override;
17
18 MOCK_METHOD1(OnIssueUpdated, void(const media_router::Issue* issue));
19 MOCK_METHOD2(OnRoutesUpdated,
20 void(const std::vector<media_router::MediaRoute>& routes,
21 const std::vector<media_router::MediaRoute::Id>&
22 joinable_route_ids));
23 MOCK_METHOD0(OnDialogShown, void());
24 MOCK_METHOD0(OnDialogHidden, void());
25 MOCK_METHOD0(MaybeAddOrRemoveAction, void());
26 };
27
28 class MockMediaRouterUIService : public media_router::MediaRouterUIService {
29 public:
30 explicit MockMediaRouterUIService(Profile* profile);
31 ~MockMediaRouterUIService() override;
32
33 MediaRouterActionController* action_controller() const override;
34
35 private:
36 std::unique_ptr<MediaRouterActionController> action_controller_;
37 };
38
39 class MediaRouterWebUITest : public BrowserWithTestWindowTest {
40 public:
41 // |require_mock_ui_service_| defaults to false in the default ctor.
42 MediaRouterWebUITest();
43 explicit MediaRouterWebUITest(bool require_mock_ui_service);
44 ~MediaRouterWebUITest() override;
45
46 protected:
47 // BrowserWithTestWindowTest:
48 BrowserWindow* CreateBrowserWindow() override;
49 TestingProfile* CreateProfile() override;
msw 2016/11/09 20:32:34 nit: reorder to match BrowserWithTestWindowTest (i
takumif 2016/11/10 01:53:59 Done.
50
51 private:
52 // When this is set to true, MockMediaRouterUIService is instantiated.
53 // Otherwise, no MediaRouterUIService is instantiated.
54 bool require_mock_ui_service_;
55
56 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUITest);
57 };
58
59 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEB_UI_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698