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

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.
mark a. foltz 2016/11/08 21:15:53 Update copyright.
takumif 2016/11/09 04:37:27 Done.
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 BrowserWindow;
msw 2016/11/04 00:07:17 nit: probably not needed; should be included from
takumif 2016/11/09 04:37:27 Removed.
14 class TestingProfile;
15
16 class MockMediaRouterActionController : public MediaRouterActionController {
msw 2016/11/04 00:07:16 nit: move these other classes to chrome/browser/me
takumif 2016/11/09 04:37:27 These classes were there originally, but were move
msw 2016/11/09 20:32:34 Move them into the cc test file or to separate fil
takumif 2016/11/10 01:53:59 Moving MockMediaRouterUIService into the .cc file
17 public:
18 explicit MockMediaRouterActionController(Profile* profile);
19 ~MockMediaRouterActionController() override;
20
21 MOCK_METHOD1(OnIssueUpdated, void(const media_router::Issue* issue));
22 MOCK_METHOD2(OnRoutesUpdated,
23 void(const std::vector<media_router::MediaRoute>& routes,
24 const std::vector<media_router::MediaRoute::Id>&
25 joinable_route_ids));
26 MOCK_METHOD0(OnDialogShown, void());
27 MOCK_METHOD0(OnDialogHidden, void());
28 MOCK_METHOD0(MaybeAddOrRemoveAction, void());
29 };
30
31 class MockMediaRouterUIService : public media_router::MediaRouterUIService {
32 public:
33 explicit MockMediaRouterUIService(Profile* profile);
34 ~MockMediaRouterUIService() override;
35
36 MediaRouterActionController* action_controller() const override;
37
38 private:
39 std::unique_ptr<MediaRouterActionController> action_controller_;
msw 2016/11/04 00:07:17 nit: avoid unique_ptr and use a plain MockMediaRou
takumif 2016/11/09 04:37:27 That would make the action_controller() getter ret
msw 2016/11/09 20:32:34 Ditto to my earlier question about the correctness
takumif 2016/11/10 01:53:59 Fixed.
40 };
41
42 class MediaRouterWebUITest : public BrowserWithTestWindowTest {
43 public:
44 // |require_mock_ui_service_| defaults to false in the default ctor.
msw 2016/11/04 00:07:17 optional nit: remove default ctor; add default val
takumif 2016/11/09 04:37:27 I feel like a default ctor is cleaner than always
msw 2016/11/09 20:32:34 A default value, as I suggested, would avoid needi
45 MediaRouterWebUITest();
46 explicit MediaRouterWebUITest(bool require_mock_ui_service);
47 ~MediaRouterWebUITest() override;
48
49 // BrowserWithTestWindowTest:
msw 2016/11/04 00:07:17 optional nit: make both overrides protected or pub
takumif 2016/11/09 04:37:27 Made them both protected.
50 TestingProfile* CreateProfile() override;
51
52 protected:
53 // BrowserWithTestWindowTest:
54 BrowserWindow* CreateBrowserWindow() override;
55
56 private:
57 // When this is set to true, MockMediaRouterUIService is instantiated.
58 // Otherwise, no MediaRouterUIService is instantiated.
59 bool require_mock_ui_service_;
60
61 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUITest);
62 };
63
64 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEB_UI_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698