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

Side by Side Diff: content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc

Issue 2763383002: Switching AudioInputDeviceManager from using AudioManager interface to AudioSystem one. (Closed)
Patch Set: Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // Unit tests for AudioOutputAuthorizationHandler. 5 // Unit tests for AudioOutputAuthorizationHandler.
6 6
7 #include "content/browser/renderer_host/media/audio_output_authorization_handler .h" 7 #include "content/browser/renderer_host/media/audio_output_authorization_handler .h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 base::Unretained(out))); 135 base::Unretained(out)));
136 } 136 }
137 137
138 // media_stream_manager must die after threads since it's a 138 // media_stream_manager must die after threads since it's a
139 // DestructionObserver. 139 // DestructionObserver.
140 std::unique_ptr<MediaStreamManager> media_stream_manager_; 140 std::unique_ptr<MediaStreamManager> media_stream_manager_;
141 std::unique_ptr<TestBrowserThreadBundle> thread_bundle_; 141 std::unique_ptr<TestBrowserThreadBundle> thread_bundle_;
142 std::unique_ptr<AudioManagerThread> audio_thread_; 142 std::unique_ptr<AudioManagerThread> audio_thread_;
143 media::FakeAudioLogFactory log_factory_; 143 media::FakeAudioLogFactory log_factory_;
144 media::ScopedAudioManagerPtr audio_manager_; 144 media::ScopedAudioManagerPtr audio_manager_;
145 std::unique_ptr<media::AudioSystem> audio_system_; 145 media::AudioSystem::UniquePtr audio_system_;
146 146
147 DISALLOW_COPY_AND_ASSIGN(AudioOutputAuthorizationHandlerTest); 147 DISALLOW_COPY_AND_ASSIGN(AudioOutputAuthorizationHandlerTest);
148 }; 148 };
149 149
150 TEST_F(AudioOutputAuthorizationHandlerTest, AuthorizeDefaultDevice_Ok) { 150 TEST_F(AudioOutputAuthorizationHandlerTest, AuthorizeDefaultDevice_Ok) {
151 MockAuthorizationCallback listener; 151 MockAuthorizationCallback listener;
152 EXPECT_CALL(listener, 152 EXPECT_CALL(listener,
153 Run(media::OUTPUT_DEVICE_STATUS_OK, false, _, kDefaultDeviceId)) 153 Run(media::OUTPUT_DEVICE_STATUS_OK, false, _, kDefaultDeviceId))
154 .Times(1); 154 .Times(1);
155 std::unique_ptr<AudioOutputAuthorizationHandler> handler = 155 std::unique_ptr<AudioOutputAuthorizationHandler> handler =
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 (base::Bind(&AudioOutputAuthorizationHandler::RequestDeviceAuthorization, 328 (base::Bind(&AudioOutputAuthorizationHandler::RequestDeviceAuthorization,
329 base::Unretained(handler.get()), kRenderFrameId, kSessionId, 329 base::Unretained(handler.get()), kRenderFrameId, kSessionId,
330 std::string(), BadSecurityOrigin(), listener.Get()))); 330 std::string(), BadSecurityOrigin(), listener.Get())));
331 331
332 SyncWithAllThreads(); 332 SyncWithAllThreads();
333 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, handler.release()); 333 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, handler.release());
334 SyncWithAllThreads(); 334 SyncWithAllThreads();
335 } 335 }
336 336
337 } // namespace content 337 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698