OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if (arg.help_page_id() != other.help_page_id()) | 70 if (arg.help_page_id() != other.help_page_id()) |
71 return false; | 71 return false; |
72 | 72 |
73 return true; | 73 return true; |
74 } | 74 } |
75 | 75 |
76 MATCHER_P(IssueTitleEquals, title, "") { | 76 MATCHER_P(IssueTitleEquals, title, "") { |
77 return arg.title() == title; | 77 return arg.title() == title; |
78 } | 78 } |
79 | 79 |
| 80 MATCHER_P(PresentationConnectionInfoEquals, other, "") { |
| 81 return arg.presentation_url == other.presentation_url && |
| 82 arg.presentation_id == other.presentation_id; |
| 83 } |
| 84 |
80 MATCHER_P(StateChageInfoEquals, other, "") { | 85 MATCHER_P(StateChageInfoEquals, other, "") { |
81 return arg.state == other.state && arg.close_reason == other.close_reason && | 86 return arg.state == other.state && arg.close_reason == other.close_reason && |
82 arg.message == other.message; | 87 arg.message == other.message; |
83 } | 88 } |
84 | 89 |
85 class MockIssuesObserver : public IssuesObserver { | 90 class MockIssuesObserver : public IssuesObserver { |
86 public: | 91 public: |
87 explicit MockIssuesObserver(MediaRouter* router); | 92 explicit MockIssuesObserver(MediaRouter* router); |
88 ~MockIssuesObserver() override; | 93 ~MockIssuesObserver() override; |
89 | 94 |
(...skipping 21 matching lines...) Expand all Loading... |
111 }; | 116 }; |
112 | 117 |
113 class MockPresentationConnectionStateChangedCallback { | 118 class MockPresentationConnectionStateChangedCallback { |
114 public: | 119 public: |
115 MockPresentationConnectionStateChangedCallback(); | 120 MockPresentationConnectionStateChangedCallback(); |
116 ~MockPresentationConnectionStateChangedCallback(); | 121 ~MockPresentationConnectionStateChangedCallback(); |
117 MOCK_METHOD1(Run, | 122 MOCK_METHOD1(Run, |
118 void(const content::PresentationConnectionStateChangeInfo&)); | 123 void(const content::PresentationConnectionStateChangeInfo&)); |
119 }; | 124 }; |
120 | 125 |
| 126 class MockPresentationMessagesCallback { |
| 127 public: |
| 128 MockPresentationMessagesCallback(); |
| 129 ~MockPresentationMessagesCallback(); |
| 130 void OnMessagesReceived( |
| 131 const ScopedVector<content::PresentationSessionMessage>& messages, |
| 132 bool pass_ownership) { |
| 133 DoOnMessagesReceived(messages[0]->message); |
| 134 } |
| 135 MOCK_METHOD1(DoOnMessagesReceived, void(const std::string&)); |
| 136 MOCK_METHOD1(OnMessageSent, void(bool)); |
| 137 }; |
| 138 |
121 } // namespace media_router | 139 } // namespace media_router |
122 | 140 |
123 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 141 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
OLD | NEW |