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

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

Issue 448943002: Disable more failing tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | components/copresence/timed_map_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_handler.h" 5 #include "components/copresence/handlers/audio/audio_directive_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "components/copresence/test/audio_test_support.h" 9 #include "components/copresence/test/audio_test_support.h"
10 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // This order is important. We want the message loop to get created before 68 // This order is important. We want the message loop to get created before
69 // our the audio directive handler since the directive list ctor (invoked 69 // our the audio directive handler since the directive list ctor (invoked
70 // from the directive handler ctor) will post tasks. 70 // from the directive handler ctor) will post tasks.
71 base::MessageLoop message_loop_; 71 base::MessageLoop message_loop_;
72 scoped_ptr<MockAudioDirectiveHandler> directive_handler_; 72 scoped_ptr<MockAudioDirectiveHandler> directive_handler_;
73 73
74 private: 74 private:
75 DISALLOW_COPY_AND_ASSIGN(AudioDirectiveHandlerTest); 75 DISALLOW_COPY_AND_ASSIGN(AudioDirectiveHandlerTest);
76 }; 76 };
77 77
78 TEST_F(AudioDirectiveHandlerTest, Basic) { 78 // TODO(rkc): Find and fix the memory leak here.
79 #define MAYBE_Basic DISABLED_Basic
80
81 TEST_F(AudioDirectiveHandlerTest, MAYBE_Basic) {
79 const base::TimeDelta kSmallTtl = base::TimeDelta::FromMilliseconds(0x1337); 82 const base::TimeDelta kSmallTtl = base::TimeDelta::FromMilliseconds(0x1337);
80 const base::TimeDelta kLargeTtl = base::TimeDelta::FromSeconds(0x7331); 83 const base::TimeDelta kLargeTtl = base::TimeDelta::FromSeconds(0x7331);
81 84
82 // Expect to play and record instructions for 'less' than the TTL specified, 85 // Expect to play and record instructions for 'less' than the TTL specified,
83 // since by the time that the token would have gotten encoded, we would 86 // since by the time that the token would have gotten encoded, we would
84 // have (TTL - time_to_encode) left to play on that instruction. 87 // have (TTL - time_to_encode) left to play on that instruction.
85 EXPECT_CALL(*directive_handler_, PlayAudio(_, testing::Le(kLargeTtl))) 88 EXPECT_CALL(*directive_handler_, PlayAudio(_, testing::Le(kLargeTtl)))
86 .Times(3); 89 .Times(3);
87 directive_handler_->AddInstruction(CreateTransmitInstruction("token1"), 90 directive_handler_->AddInstruction(CreateTransmitInstruction("token1"),
88 kLargeTtl); 91 kLargeTtl);
89 directive_handler_->AddInstruction(CreateTransmitInstruction("token2"), 92 directive_handler_->AddInstruction(CreateTransmitInstruction("token2"),
90 kLargeTtl); 93 kLargeTtl);
91 directive_handler_->AddInstruction(CreateTransmitInstruction("token3"), 94 directive_handler_->AddInstruction(CreateTransmitInstruction("token3"),
92 kSmallTtl); 95 kSmallTtl);
93 96
94 EXPECT_CALL(*directive_handler_, RecordAudio(Le(kLargeTtl))).Times(3); 97 EXPECT_CALL(*directive_handler_, RecordAudio(Le(kLargeTtl))).Times(3);
95 directive_handler_->AddInstruction(CreateReceiveInstruction(), kLargeTtl); 98 directive_handler_->AddInstruction(CreateReceiveInstruction(), kLargeTtl);
96 directive_handler_->AddInstruction(CreateReceiveInstruction(), kSmallTtl); 99 directive_handler_->AddInstruction(CreateReceiveInstruction(), kSmallTtl);
97 directive_handler_->AddInstruction(CreateReceiveInstruction(), kLargeTtl); 100 directive_handler_->AddInstruction(CreateReceiveInstruction(), kLargeTtl);
98 } 101 }
99 102
100 // TODO(rkc): When we are keeping track of which token we're currently playing, 103 // TODO(rkc): When we are keeping track of which token we're currently playing,
101 // add tests to make sure we don't replay if we get a token with a lower ttl 104 // add tests to make sure we don't replay if we get a token with a lower ttl
102 // than the current active. 105 // than the current active.
103 106
104 } // namespace copresence 107 } // namespace copresence
OLDNEW
« no previous file with comments | « no previous file | components/copresence/timed_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698