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

Side by Side Diff: media/audio/fake_audio_input_stream_unittest.cc

Issue 6018001: Mark FakeAudioInputTest.BasicCallbacks as flaky.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/platform_thread.h" 6 #include "base/platform_thread.h"
7 #include "media/audio/audio_io.h" 7 #include "media/audio/audio_io.h"
8 #include "media/audio/audio_manager.h" 8 #include "media/audio/audio_manager.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 14 matching lines...) Expand all
25 MOCK_METHOD3(OnData, void(AudioInputStream* stream, const uint8* src, 25 MOCK_METHOD3(OnData, void(AudioInputStream* stream, const uint8* src,
26 uint32 size)); 26 uint32 size));
27 private: 27 private:
28 DISALLOW_COPY_AND_ASSIGN(MockAudioInputCallback); 28 DISALLOW_COPY_AND_ASSIGN(MockAudioInputCallback);
29 }; 29 };
30 30
31 } 31 }
32 32
33 // ============================================================================ 33 // ============================================================================
34 // Validate that the AudioManager::AUDIO_MOCK callbacks work. 34 // Validate that the AudioManager::AUDIO_MOCK callbacks work.
35 TEST(FakeAudioInputTest, BasicCallbacks) { 35 // Flaky, http://crbug.com/49497.
36 TEST(FakeAudioInputTest, FLAKY_BasicCallbacks) {
36 MockAudioInputCallback callback; 37 MockAudioInputCallback callback;
37 EXPECT_CALL(callback, OnData(NotNull(), _, _)).Times(AtLeast(5)); 38 EXPECT_CALL(callback, OnData(NotNull(), _, _)).Times(AtLeast(5));
38 EXPECT_CALL(callback, OnError(NotNull(), _)).Times(Exactly(0)); 39 EXPECT_CALL(callback, OnError(NotNull(), _)).Times(Exactly(0));
39 40
40 AudioManager* audio_man = AudioManager::GetAudioManager(); 41 AudioManager* audio_man = AudioManager::GetAudioManager();
41 ASSERT_TRUE(NULL != audio_man); 42 ASSERT_TRUE(NULL != audio_man);
42 // Ask for one recorded packet every 50ms. 43 // Ask for one recorded packet every 50ms.
43 AudioInputStream* stream = audio_man->MakeAudioInputStream( 44 AudioInputStream* stream = audio_man->MakeAudioInputStream(
44 AudioParameters(AudioParameters::AUDIO_MOCK, 2, 8000, 8, 400)); 45 AudioParameters(AudioParameters::AUDIO_MOCK, 2, 8000, 8, 400));
45 ASSERT_TRUE(NULL != stream); 46 ASSERT_TRUE(NULL != stream);
46 EXPECT_TRUE(stream->Open()); 47 EXPECT_TRUE(stream->Open());
47 stream->Start(&callback); 48 stream->Start(&callback);
48 PlatformThread::Sleep(340); // Give sufficient time to receive 5 / 6 packets. 49 PlatformThread::Sleep(340); // Give sufficient time to receive 5 / 6 packets.
49 stream->Stop(); 50 stream->Stop();
50 stream->Close(); 51 stream->Close();
51 } 52 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698