OLD | NEW |
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/StereoPannerNode.h" | 6 #include "modules/webaudio/StereoPannerNode.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(StereoPannerNodeTest, StereoPannerLifetime) | 14 TEST(StereoPannerNodeTest, StereoPannerLifetime) |
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 StereoPannerNode* node = context->createStereoPanner(ASSERT_NO_EXCEPTION); | 18 StereoPannerNode* node = context->createStereoPanner(ASSERT_NO_EXCEPTION); |
19 StereoPannerHandler& handler = static_cast<StereoPannerHandler&>(node->handl
er()); | 19 StereoPannerHandler& handler = static_cast<StereoPannerHandler&>(node->handl
er()); |
20 EXPECT_TRUE(handler.m_stereoPanner); | 20 EXPECT_TRUE(handler.m_stereoPanner); |
21 AudioContext::AutoLocker locker(context); | 21 AbstractAudioContext::AutoLocker locker(context); |
22 handler.dispose(); | 22 handler.dispose(); |
23 // m_stereoPanner should live after dispose() because an audio thread is | 23 // m_stereoPanner should live after dispose() because an audio thread is |
24 // using it. | 24 // using it. |
25 EXPECT_TRUE(handler.m_stereoPanner); | 25 EXPECT_TRUE(handler.m_stereoPanner); |
26 } | 26 } |
27 | 27 |
28 } // namespace blink | 28 } // namespace blink |
OLD | NEW |