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

Unified Diff: chrome/browser/media/router/test_helper.h

Issue 1259333004: [MediaRouter]Wires up issue manager in MediaRouterMojoImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/test_helper.h
diff --git a/chrome/browser/media/router/test_helper.h b/chrome/browser/media/router/test_helper.h
index ba5a47787e8b624aedce8884dd3ec92ac5c56e6a..4e0a200efc0e47b6f831f9ef9b970b8e61bfdb80 100644
--- a/chrome/browser/media/router/test_helper.h
+++ b/chrome/browser/media/router/test_helper.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "chrome/browser/media/router/issues_observer.h"
#include "chrome/browser/media/router/media_router.mojom.h"
#include "chrome/browser/media/router/media_router_mojo_impl.h"
#include "chrome/browser/media/router/media_routes_observer.h"
@@ -36,6 +37,48 @@ MATCHER_P(SequenceEquals, other, "") {
return true;
}
+// Matcher for checking all fields in Issue objects except the ID.
+MATCHER_P(EqualsIssue, other, "") {
+ if (arg.title().compare(other.title()) != 0)
Kevin M 2015/07/30 17:18:42 Just do !=?
haibinlu 2015/07/30 21:00:09 Done.
+ return false;
+
+ if (arg.message().compare(other.message()) != 0)
+ return false;
+
+ if (!arg.default_action().Equals(other.default_action()))
+ return false;
+
+ if (arg.secondary_actions().size() != other.secondary_actions().size())
+ return false;
+
+ for (size_t i = 0; i < arg.secondary_actions().size(); ++i) {
+ if (!arg.secondary_actions()[i].Equals(other.secondary_actions()[i]))
+ return false;
+ }
+
+ if (arg.route_id().compare(other.route_id()) != 0)
+ return false;
+
+ if (arg.severity() != other.severity())
+ return false;
+
+ if (arg.is_blocking() != other.is_blocking())
+ return false;
+
+ if (arg.help_url() != other.help_url())
+ return false;
+
+ return true;
+}
+
+class MockIssuesObserver : public IssuesObserver {
+ public:
+ MockIssuesObserver(MediaRouter* router);
+ ~MockIssuesObserver() override;
+
+ MOCK_METHOD1(OnIssueUpdated, void(const Issue* issue));
+};
+
class MockMediaRouteProvider : public interfaces::MediaRouteProvider {
public:
MockMediaRouteProvider();

Powered by Google App Engine
This is Rietveld 408576698