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

Side by Side Diff: Source/modules/webaudio/ConvolverNodeTest.cpp

Issue 1214463003: Split "Online" and "Offline" AudioContext processing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring to ToT Created 5 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "config.h" 5 #include "config.h"
6 #include "modules/webaudio/ConvolverNode.h" 6 #include "modules/webaudio/ConvolverNode.h"
7 7
8 #include "core/testing/DummyPageHolder.h" 8 #include "core/testing/DummyPageHolder.h"
9 #include "modules/webaudio/OfflineAudioContext.h" 9 #include "modules/webaudio/OfflineAudioContext.h"
10 #include <gtest/gtest.h> 10 #include <gtest/gtest.h>
11 11
12 namespace blink { 12 namespace blink {
13 13
14 TEST(ConvolverNodeTest, ReverbLifetime) 14 TEST(ConvolverNodeTest, ReverbLifetime)
15 { 15 {
16 OwnPtr<DummyPageHolder> page = DummyPageHolder::create(); 16 OwnPtr<DummyPageHolder> page = DummyPageHolder::create();
17 OfflineAudioContext* context = OfflineAudioContext::create(&page->document() , 2, 1, 48000, ASSERT_NO_EXCEPTION); 17 OfflineAudioContext* context = OfflineAudioContext::create(&page->document() , 2, 1, 48000, ASSERT_NO_EXCEPTION);
18 ConvolverNode* node = context->createConvolver(ASSERT_NO_EXCEPTION); 18 ConvolverNode* node = context->createConvolver(ASSERT_NO_EXCEPTION);
19 ConvolverHandler& handler = node->convolverHandler(); 19 ConvolverHandler& handler = node->convolverHandler();
20 EXPECT_FALSE(handler.m_reverb); 20 EXPECT_FALSE(handler.m_reverb);
21 node->setBuffer(AudioBuffer::create(2, 1, 48000), ASSERT_NO_EXCEPTION); 21 node->setBuffer(AudioBuffer::create(2, 1, 48000), ASSERT_NO_EXCEPTION);
22 EXPECT_TRUE(handler.m_reverb); 22 EXPECT_TRUE(handler.m_reverb);
23 AudioContext::AutoLocker locker(context); 23 AbstractAudioContext::AutoLocker locker(context);
24 handler.dispose(); 24 handler.dispose();
25 // m_reverb should live after dispose() because an audio thread is using it. 25 // m_reverb should live after dispose() because an audio thread is using it.
26 EXPECT_TRUE(handler.m_reverb); 26 EXPECT_TRUE(handler.m_reverb);
27 } 27 }
28 28
29 } // namespace blink 29 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/webaudio/ConvolverNode.cpp ('k') | Source/modules/webaudio/DefaultAudioDestinationNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698