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

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

Issue 3185022: Share one thread between all AudioOutputControllers instead of creating one per stream. (Closed)
Patch Set: - Created 10 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
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/logging.h" 5 #include "base/logging.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "media/audio/audio_manager.h"
9 #include "media/audio/fake_audio_output_stream.h" 10 #include "media/audio/fake_audio_output_stream.h"
10 #include "media/audio/simple_sources.h" 11 #include "media/audio/simple_sources.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 namespace { 14 namespace {
14 15
15 void GenerateRandomData(char* buffer, uint32 len) { 16 void GenerateRandomData(char* buffer, uint32 len) {
16 static bool called = false; 17 static bool called = false;
17 if (!called) { 18 if (!called) {
18 called = true; 19 called = true;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 EXPECT_EQ(0, last_buffer[0]); 99 EXPECT_EQ(0, last_buffer[0]);
99 EXPECT_EQ(5126, last_buffer[1]); 100 EXPECT_EQ(5126, last_buffer[1]);
100 EXPECT_TRUE(last_buffer[1] < last_buffer[2]); 101 EXPECT_TRUE(last_buffer[1] < last_buffer[2]);
101 EXPECT_TRUE(last_buffer[2] < last_buffer[3]); 102 EXPECT_TRUE(last_buffer[2] < last_buffer[3]);
102 // Spot test negative incursion of sine wave. 103 // Spot test negative incursion of sine wave.
103 EXPECT_EQ(0, last_buffer[half_period]); 104 EXPECT_EQ(0, last_buffer[half_period]);
104 EXPECT_EQ(-5126, last_buffer[half_period + 1]); 105 EXPECT_EQ(-5126, last_buffer[half_period + 1]);
105 EXPECT_TRUE(last_buffer[half_period + 1] > last_buffer[half_period + 2]); 106 EXPECT_TRUE(last_buffer[half_period + 1] > last_buffer[half_period + 2]);
106 EXPECT_TRUE(last_buffer[half_period + 2] > last_buffer[half_period + 3]); 107 EXPECT_TRUE(last_buffer[half_period + 2] > last_buffer[half_period + 3]);
107 } 108 }
OLDNEW
« no previous file with comments | « media/audio/openbsd/audio_manager_openbsd.cc ('k') | media/audio/win/audio_input_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698