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

Unified Diff: components/copresence/test/fake_directive_handler.h

Issue 712833002: Undoing revert, cl is not the cause of gcm crash on canary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2214
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: components/copresence/test/fake_directive_handler.h
diff --git a/components/copresence/test/fake_directive_handler.h b/components/copresence/test/fake_directive_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..f7b591cf106e77910ba448869ae523ad77b59e85
--- /dev/null
+++ b/components/copresence/test/fake_directive_handler.h
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_COPRESENCE_TEST_FAKE_DIRECTIVE_HANDLER_H_
+#define COMPONENTS_COPRESENCE_TEST_FAKE_DIRECTIVE_HANDLER_H_
+
+#include <string>
+#include <vector>
+
+#include "components/copresence/handlers/directive_handler.h"
+
+namespace copresence {
+
+// TODO(ckehoe): Make DirectiveHandler an interface.
+class FakeDirectiveHandler final : public DirectiveHandler {
+ public:
+ FakeDirectiveHandler();
+ ~FakeDirectiveHandler() override;
+
+ const std::vector<std::string>& added_directives() const {
+ return added_directives_;
+ }
+
+ const std::vector<std::string>& removed_directives() const {
+ return removed_directives_;
+ }
+
+ void Start(WhispernetClient* /* whispernet_client */,
+ const TokensCallback& /* tokens_cb */) override {}
+
+ void AddDirective(const Directive& directive) override;
+
+ void RemoveDirectives(const std::string& op_id) override;
+
+ const std::string GetCurrentAudioToken(AudioType type) const override;
+
+ bool IsAudioTokenHeard(AudioType type) const override;
+
+ private:
+ std::vector<std::string> added_directives_;
+ std::vector<std::string> removed_directives_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeDirectiveHandler);
+};
+
+} // namespace copresence
+
+#endif // COMPONENTS_COPRESENCE_TEST_FAKE_DIRECTIVE_HANDLER_H_
« no previous file with comments | « components/copresence/rpc/rpc_handler_unittest.cc ('k') | components/copresence/test/fake_directive_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698