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

Side by Side Diff: chrome/browser/notifications/notification_audio_controller_unittest.cc

Issue 14273018: Use the browser UI thread for audio on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/notifications/notification_audio_controller.h" 5 #include "chrome/browser/notifications/notification_audio_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 22 matching lines...) Expand all
33 class NotificationAudioControllerTest : public testing::Test { 33 class NotificationAudioControllerTest : public testing::Test {
34 public: 34 public:
35 NotificationAudioControllerTest() { 35 NotificationAudioControllerTest() {
36 audio_manager_.reset(media::AudioManager::Create()); 36 audio_manager_.reset(media::AudioManager::Create());
37 notification_audio_controller_ = new NotificationAudioController(); 37 notification_audio_controller_ = new NotificationAudioController();
38 notification_audio_controller_->UseFakeAudioOutputForTest(); 38 notification_audio_controller_->UseFakeAudioOutputForTest();
39 } 39 }
40 40
41 virtual ~NotificationAudioControllerTest() { 41 virtual ~NotificationAudioControllerTest() {
42 notification_audio_controller_->RequestShutdown(); 42 notification_audio_controller_->RequestShutdown();
43 base::RunLoop().RunUntilIdle();
43 audio_manager_.reset(); 44 audio_manager_.reset();
44 } 45 }
45 46
46 protected: 47 protected:
47 NotificationAudioController* notification_audio_controller() { 48 NotificationAudioController* notification_audio_controller() {
48 return notification_audio_controller_; 49 return notification_audio_controller_;
49 } 50 }
50 Profile* profile() { return &profile_; } 51 Profile* profile() { return &profile_; }
51 52
52 size_t GetHandlersSize() { 53 size_t GetHandlersSize() {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 notification_audio_controller()->RequestPlayNotificationSound( 118 notification_audio_controller()->RequestPlayNotificationSound(
118 kDummyNotificationId, 119 kDummyNotificationId,
119 profile(), 120 profile(),
120 base::StringPiece(kTestAudioData, arraysize(kTestAudioData))); 121 base::StringPiece(kTestAudioData, arraysize(kTestAudioData)));
121 notification_audio_controller()->RequestPlayNotificationSound( 122 notification_audio_controller()->RequestPlayNotificationSound(
122 kDummyNotificationId, 123 kDummyNotificationId,
123 &profile2, 124 &profile2,
124 base::StringPiece(kTestAudioData, arraysize(kTestAudioData))); 125 base::StringPiece(kTestAudioData, arraysize(kTestAudioData)));
125 EXPECT_EQ(2u, GetHandlersSize()); 126 EXPECT_EQ(2u, GetHandlersSize());
126 } 127 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698