| Index: components/copresence/handlers/directive_handler_unittest.cc
|
| diff --git a/components/copresence/handlers/directive_handler_unittest.cc b/components/copresence/handlers/directive_handler_unittest.cc
|
| index 72e44104133e489ec1c8a61f883e8aac0281536f..f65b9cf641358bd225a12b4f864750db1770a116 100644
|
| --- a/components/copresence/handlers/directive_handler_unittest.cc
|
| +++ b/components/copresence/handlers/directive_handler_unittest.cc
|
| @@ -2,6 +2,10 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include <string>
|
| +#include <vector>
|
| +
|
| +#include "base/bind.h"
|
| #include "base/time/time.h"
|
| #include "components/copresence/handlers/audio/audio_directive_handler.h"
|
| #include "components/copresence/handlers/directive_handler_impl.h"
|
| @@ -22,10 +26,12 @@
|
|
|
| namespace copresence {
|
|
|
| -Directive CreateDirective(const std::string& publish_id,
|
| - const std::string& subscribe_id,
|
| - const std::string& token,
|
| - int64 ttl_ms) {
|
| +void IgnoreDirectiveUpdates(const std::vector<Directive>& /* directives */) {}
|
| +
|
| +const Directive CreateDirective(const std::string& publish_id,
|
| + const std::string& subscribe_id,
|
| + const std::string& token,
|
| + int64 ttl_ms) {
|
| Directive directive;
|
| directive.set_instruction_type(TOKEN);
|
| directive.set_published_message_id(publish_id);
|
| @@ -40,9 +46,9 @@
|
| return directive;
|
| }
|
|
|
| -Directive CreateDirective(const std::string& publish_id,
|
| - const std::string& subscribe_id,
|
| - const std::string& token) {
|
| +const Directive CreateDirective(const std::string& publish_id,
|
| + const std::string& subscribe_id,
|
| + const std::string& token) {
|
| return CreateDirective(publish_id, subscribe_id, token, kDefaultTtl);
|
| }
|
|
|
| @@ -53,11 +59,10 @@
|
| void Initialize(WhispernetClient* /* whispernet_client */,
|
| const TokensCallback& /* tokens_cb */) override {}
|
|
|
| - void AddInstruction(const TokenInstruction& instruction,
|
| - const std::string& /* op_id */,
|
| - base::TimeDelta ttl) override {
|
| - added_tokens_.push_back(instruction.token_id());
|
| - added_ttls_.push_back(ttl.InMilliseconds());
|
| + void AddInstruction(const Directive& directive,
|
| + const std::string& /* op_id */) override {
|
| + added_tokens_.push_back(directive.token_instruction().token_id());
|
| + added_ttls_.push_back(directive.ttl_millis());
|
| }
|
|
|
| void RemoveInstructions(const std::string& op_id) override {
|
| @@ -98,6 +103,7 @@
|
| : whispernet_client_(new StubWhispernetClient),
|
| audio_handler_(new FakeAudioDirectiveHandler),
|
| directive_handler_(
|
| + base::Bind(&IgnoreDirectiveUpdates),
|
| make_scoped_ptr<AudioDirectiveHandler>(audio_handler_)) {}
|
|
|
| protected:
|
|
|