blob: a195c09a37364111f5c76e66f49653512c6eb745 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "modules/webaudio/StereoPannerNode.h"
#include "core/testing/DummyPageHolder.h"
#include "modules/webaudio/OfflineAudioContext.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
TEST(StereoPannerNodeTest, StereoPannerLifetime)
{
OwnPtr<DummyPageHolder> page = DummyPageHolder::create();
OfflineAudioContext* context = OfflineAudioContext::create(&page->document(), 2, 1, 48000, ASSERT_NO_EXCEPTION);
StereoPannerNode* node = context->createStereoPanner(ASSERT_NO_EXCEPTION);
StereoPannerHandler& handler = static_cast<StereoPannerHandler&>(node->handler());
EXPECT_TRUE(handler.m_stereoPanner);
AbstractAudioContext::AutoLocker locker(context);
handler.dispose();
// m_stereoPanner should live after dispose() because an audio thread is
// using it.
EXPECT_TRUE(handler.m_stereoPanner);
}
} // namespace blink
|