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

Side by Side Diff: chrome/browser/media/router/test_helper.h

Issue 2176613003: [Media Router] Clean up issues related code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IssueObserver init behavior and use StructTraits Created 4 years, 2 months 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
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 21 matching lines...) Expand all
32 return false; 32 return false;
33 } 33 }
34 for (size_t i = 0; i < arg.size(); ++i) { 34 for (size_t i = 0; i < arg.size(); ++i) {
35 if (!arg[i].Equals(other[i])) { 35 if (!arg[i].Equals(other[i])) {
36 return false; 36 return false;
37 } 37 }
38 } 38 }
39 return true; 39 return true;
40 } 40 }
41 41
42 // Matcher for checking all fields in Issue objects except the ID. 42 // Matcher for IssueInfo title.
43 MATCHER_P(EqualsIssue, other, "") {
44 if (arg.title() != other.title())
45 return false;
46
47 if (arg.message() != other.message())
48 return false;
49
50 if (!arg.default_action().Equals(other.default_action()))
51 return false;
52
53 if (arg.secondary_actions().size() != other.secondary_actions().size())
54 return false;
55
56 for (size_t i = 0; i < arg.secondary_actions().size(); ++i) {
57 if (!arg.secondary_actions()[i].Equals(other.secondary_actions()[i]))
58 return false;
59 }
60
61 if (arg.route_id() != other.route_id())
62 return false;
63
64 if (arg.severity() != other.severity())
65 return false;
66
67 if (arg.is_blocking() != other.is_blocking())
68 return false;
69
70 if (arg.help_page_id() != other.help_page_id())
71 return false;
72
73 return true;
74 }
75
76 MATCHER_P(IssueTitleEquals, title, "") { 43 MATCHER_P(IssueTitleEquals, title, "") {
77 return arg.title() == title; 44 return arg.title == title;
78 } 45 }
79 46
80 MATCHER_P(StateChangeInfoEquals, other, "") { 47 MATCHER_P(StateChangeInfoEquals, other, "") {
81 return arg.state == other.state && arg.close_reason == other.close_reason && 48 return arg.state == other.state && arg.close_reason == other.close_reason &&
82 arg.message == other.message; 49 arg.message == other.message;
83 } 50 }
84 51
85 class MockIssuesObserver : public IssuesObserver { 52 class MockIssuesObserver : public IssuesObserver {
86 public: 53 public:
87 explicit MockIssuesObserver(MediaRouter* router); 54 explicit MockIssuesObserver(MediaRouter* router);
(...skipping 26 matching lines...) Expand all
114 public: 81 public:
115 MockPresentationConnectionStateChangedCallback(); 82 MockPresentationConnectionStateChangedCallback();
116 ~MockPresentationConnectionStateChangedCallback(); 83 ~MockPresentationConnectionStateChangedCallback();
117 MOCK_METHOD1(Run, 84 MOCK_METHOD1(Run,
118 void(const content::PresentationConnectionStateChangeInfo&)); 85 void(const content::PresentationConnectionStateChangeInfo&));
119 }; 86 };
120 87
121 } // namespace media_router 88 } // namespace media_router
122 89
123 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ 90 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698