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

Side by Side Diff: media/audio/win/audio_device_listener_win_unittest.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 29 matching lines...) Expand all
40 // Simulate a device change where no output devices are available. 40 // Simulate a device change where no output devices are available.
41 bool SimulateNullDefaultOutputDeviceChange() { 41 bool SimulateNullDefaultOutputDeviceChange() {
42 return output_device_listener_->OnDefaultDeviceChanged( 42 return output_device_listener_->OnDefaultDeviceChanged(
43 static_cast<EDataFlow>(eConsole), static_cast<ERole>(eRender), 43 static_cast<EDataFlow>(eConsole), static_cast<ERole>(eRender),
44 NULL) == S_OK; 44 NULL) == S_OK;
45 } 45 }
46 46
47 bool SimulateDefaultOutputDeviceChange(const char* new_device_id) { 47 bool SimulateDefaultOutputDeviceChange(const char* new_device_id) {
48 return output_device_listener_->OnDefaultDeviceChanged( 48 return output_device_listener_->OnDefaultDeviceChanged(
49 static_cast<EDataFlow>(eConsole), static_cast<ERole>(eRender), 49 static_cast<EDataFlow>(eConsole), static_cast<ERole>(eRender),
50 ASCIIToWide(new_device_id).c_str()) == S_OK; 50 base::ASCIIToWide(new_device_id).c_str()) == S_OK;
51 } 51 }
52 52
53 void SetOutputDeviceId(std::string new_device_id) { 53 void SetOutputDeviceId(std::string new_device_id) {
54 output_device_listener_->default_render_device_id_ = new_device_id; 54 output_device_listener_->default_render_device_id_ = new_device_id;
55 } 55 }
56 56
57 MOCK_METHOD0(OnDeviceChange, void()); 57 MOCK_METHOD0(OnDeviceChange, void());
58 58
59 private: 59 private:
60 ScopedCOMInitializer com_init_; 60 ScopedCOMInitializer com_init_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 testing::Mock::VerifyAndClear(this); 94 testing::Mock::VerifyAndClear(this);
95 EXPECT_CALL(*this, OnDeviceChange()).Times(1); 95 EXPECT_CALL(*this, OnDeviceChange()).Times(1);
96 ASSERT_TRUE(SimulateDefaultOutputDeviceChange(kFirstTestDevice)); 96 ASSERT_TRUE(SimulateDefaultOutputDeviceChange(kFirstTestDevice));
97 97
98 testing::Mock::VerifyAndClear(this); 98 testing::Mock::VerifyAndClear(this);
99 EXPECT_CALL(*this, OnDeviceChange()).Times(1); 99 EXPECT_CALL(*this, OnDeviceChange()).Times(1);
100 ASSERT_TRUE(SimulateNullDefaultOutputDeviceChange()); 100 ASSERT_TRUE(SimulateNullDefaultOutputDeviceChange());
101 } 101 }
102 102
103 } // namespace media 103 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_device_listener_win.cc ('k') | media/audio/win/audio_low_latency_input_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698