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

Side by Side Diff: components/copresence/handlers/audio/audio_directive_list_unittest.cc

Issue 690213004: Refactoring AudioDirectiveHandler to support testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/copresence/handlers/audio/audio_directive_list.h" 5 #include "components/copresence/handlers/audio/audio_directive_list.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
11 11
12 using testing::IsNull; 12 using testing::IsNull;
13 13
14 namespace copresence { 14 namespace copresence {
15 15
16 class AudioDirectiveListTest : public testing::Test { 16 class AudioDirectiveListTest : public testing::Test {
17 public: 17 public:
18 AudioDirectiveListTest() : directive_list_(new AudioDirectiveList()) {} 18 AudioDirectiveListTest() : directive_list_(new AudioDirectiveList) {}
19
20 ~AudioDirectiveListTest() override {}
21 19
22 protected: 20 protected:
23 base::MessageLoop message_loop_; 21 base::MessageLoop message_loop_;
24 scoped_ptr<AudioDirectiveList> directive_list_; 22 scoped_ptr<AudioDirectiveList> directive_list_;
25 }; 23 };
26 24
27 TEST_F(AudioDirectiveListTest, Basic) { 25 TEST_F(AudioDirectiveListTest, Basic) {
28 const base::TimeDelta kTtl = base::TimeDelta::FromSeconds(9999); 26 const base::TimeDelta kTtl = base::TimeDelta::FromSeconds(9999);
29 27
30 EXPECT_THAT(directive_list_->GetActiveDirective(), IsNull()); 28 EXPECT_THAT(directive_list_->GetActiveDirective(), IsNull());
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 directive_list_->RemoveDirective("op_id3"); 71 directive_list_->RemoveDirective("op_id3");
74 directive_list_->RemoveDirective("op_id3"); 72 directive_list_->RemoveDirective("op_id3");
75 EXPECT_EQ("op_id2", directive_list_->GetActiveDirective()->op_id); 73 EXPECT_EQ("op_id2", directive_list_->GetActiveDirective()->op_id);
76 directive_list_->RemoveDirective("op_id2"); 74 directive_list_->RemoveDirective("op_id2");
77 EXPECT_EQ("op_id1", directive_list_->GetActiveDirective()->op_id); 75 EXPECT_EQ("op_id1", directive_list_->GetActiveDirective()->op_id);
78 directive_list_->RemoveDirective("op_id1"); 76 directive_list_->RemoveDirective("op_id1");
79 EXPECT_THAT(directive_list_->GetActiveDirective(), IsNull()); 77 EXPECT_THAT(directive_list_->GetActiveDirective(), IsNull());
80 } 78 }
81 79
82 } // namespace copresence 80 } // namespace copresence
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698