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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNodeTest.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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 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 "modules/webaudio/DynamicsCompressorNode.h"
6 #include "core/testing/DummyPageHolder.h" 5 #include "core/testing/DummyPageHolder.h"
7 #include "modules/webaudio/AbstractAudioContext.h" 6 #include "modules/webaudio/AbstractAudioContext.h"
7 #include "modules/webaudio/DynamicsCompressorNode.h"
8 #include "modules/webaudio/OfflineAudioContext.h" 8 #include "modules/webaudio/OfflineAudioContext.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include <memory>
10 11
11 namespace blink { 12 namespace blink {
12 13
13 TEST(DynamicsCompressorNodeTest, ProcessorLifetime) 14 TEST(DynamicsCompressorNodeTest, ProcessorLifetime)
14 { 15 {
15 OwnPtr<DummyPageHolder> page = DummyPageHolder::create(); 16 std::unique_ptr<DummyPageHolder> page = DummyPageHolder::create();
16 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);
17 DynamicsCompressorNode* node = context->createDynamicsCompressor(ASSERT_NO_E XCEPTION); 18 DynamicsCompressorNode* node = context->createDynamicsCompressor(ASSERT_NO_E XCEPTION);
18 DynamicsCompressorHandler& handler = node->dynamicsCompressorHandler(); 19 DynamicsCompressorHandler& handler = node->dynamicsCompressorHandler();
19 EXPECT_TRUE(handler.m_dynamicsCompressor); 20 EXPECT_TRUE(handler.m_dynamicsCompressor);
20 AbstractAudioContext::AutoLocker locker(context); 21 AbstractAudioContext::AutoLocker locker(context);
21 handler.dispose(); 22 handler.dispose();
22 // m_dynamicsCompressor should live after dispose() because an audio thread 23 // m_dynamicsCompressor should live after dispose() because an audio thread
23 // is using it. 24 // is using it.
24 EXPECT_TRUE(handler.m_dynamicsCompressor); 25 EXPECT_TRUE(handler.m_dynamicsCompressor);
25 } 26 }
26 27
27 } // namespace blink 28 } // namespace blink
28 29
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698