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

Side by Side Diff: media/audio/sounds/wav_audio_handler_unittest.cc

Issue 115693004: Added volume adjust sound behind the flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 7 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/basictypes.h"
6 #include "base/logging.h"
7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string_piece.h"
9 #include "media/audio/sounds/test_data.h"
10 #include "media/audio/sounds/wav_audio_handler.h"
11 #include "media/base/audio_bus.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace media {
15
16 TEST(WavAudioHandlerTest, SampleDataTest) {
17 WavAudioHandler handler(base::StringPiece(kTestAudioData,
18 arraysize(kTestAudioData)));
19 ASSERT_EQ(static_cast<uint16>(2), handler.num_channels());
20 ASSERT_EQ(static_cast<uint16>(16), handler.bits_per_sample());
21 ASSERT_EQ(static_cast<uint32>(48000), handler.sample_rate());
22 ASSERT_EQ(static_cast<uint32>(96000), handler.byte_rate());
23
24 ASSERT_EQ(4, handler.size());
25 scoped_ptr<AudioBus> bus = AudioBus::Create(
26 handler.num_channels(),
27 handler.size() / handler.num_channels());
28 size_t bytes_written;
29 ASSERT_TRUE(handler.CopyTo(bus.get(), 0, &bytes_written));
30 ASSERT_EQ(static_cast<size_t>(handler.size()), bytes_written);
31 }
32
33 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698