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

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

Issue 2940933003: DO NOT SUBMIT results of new clang-format (Closed)
Patch Set: Created 3 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 <memory>
5 #include "core/testing/DummyPageHolder.h" 6 #include "core/testing/DummyPageHolder.h"
6 #include "modules/webaudio/OfflineAudioContext.h" 7 #include "modules/webaudio/OfflineAudioContext.h"
7 #include "modules/webaudio/ScriptProcessorNode.h" 8 #include "modules/webaudio/ScriptProcessorNode.h"
8 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
9 #include <memory>
10 10
11 namespace blink { 11 namespace blink {
12 12
13 TEST(ScriptProcessorNodeTest, BufferLifetime) { 13 TEST(ScriptProcessorNodeTest, BufferLifetime) {
14 std::unique_ptr<DummyPageHolder> page = DummyPageHolder::Create(); 14 std::unique_ptr<DummyPageHolder> page = DummyPageHolder::Create();
15 OfflineAudioContext* context = OfflineAudioContext::Create( 15 OfflineAudioContext* context = OfflineAudioContext::Create(
16 &page->GetDocument(), 2, 1, 48000, ASSERT_NO_EXCEPTION); 16 &page->GetDocument(), 2, 1, 48000, ASSERT_NO_EXCEPTION);
17 ScriptProcessorNode* node = 17 ScriptProcessorNode* node =
18 context->createScriptProcessor(ASSERT_NO_EXCEPTION); 18 context->createScriptProcessor(ASSERT_NO_EXCEPTION);
19 ScriptProcessorHandler& handler = 19 ScriptProcessorHandler& handler =
20 static_cast<ScriptProcessorHandler&>(node->Handler()); 20 static_cast<ScriptProcessorHandler&>(node->Handler());
21 EXPECT_EQ(2u, handler.input_buffers_.size()); 21 EXPECT_EQ(2u, handler.input_buffers_.size());
22 EXPECT_EQ(2u, handler.output_buffers_.size()); 22 EXPECT_EQ(2u, handler.output_buffers_.size());
23 BaseAudioContext::AutoLocker locker(context); 23 BaseAudioContext::AutoLocker locker(context);
24 handler.Dispose(); 24 handler.Dispose();
25 // Buffers should live after dispose() because an audio thread is using 25 // Buffers should live after dispose() because an audio thread is using
26 // them. 26 // them.
27 EXPECT_EQ(2u, handler.input_buffers_.size()); 27 EXPECT_EQ(2u, handler.input_buffers_.size());
28 EXPECT_EQ(2u, handler.output_buffers_.size()); 28 EXPECT_EQ(2u, handler.output_buffers_.size());
29 } 29 }
30 30
31 } // namespace blink 31 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698