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

Side by Side Diff: media/audio/win/core_audio_util_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
« no previous file with comments | « media/audio/win/core_audio_util_win.cc ('k') | media/audio/win/device_enumeration_win.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 (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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "base/win/scoped_co_mem.h" 8 #include "base/win/scoped_co_mem.h"
9 #include "base/win/scoped_com_initializer.h" 9 #include "base/win/scoped_com_initializer.h"
10 #include "base/win/scoped_handle.h" 10 #include "base/win/scoped_handle.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 ASSERT_TRUE(SUCCEEDED(enumerator->EnumAudioEndpoints(eCapture, 497 ASSERT_TRUE(SUCCEEDED(enumerator->EnumAudioEndpoints(eCapture,
498 DEVICE_STATE_ACTIVE, collection.Receive()))); 498 DEVICE_STATE_ACTIVE, collection.Receive())));
499 UINT count = 0; 499 UINT count = 0;
500 collection->GetCount(&count); 500 collection->GetCount(&count);
501 for (UINT i = 0; i < count && !found_a_pair; ++i) { 501 for (UINT i = 0; i < count && !found_a_pair; ++i) {
502 ScopedComPtr<IMMDevice> device; 502 ScopedComPtr<IMMDevice> device;
503 collection->Item(i, device.Receive()); 503 collection->Item(i, device.Receive());
504 base::win::ScopedCoMem<WCHAR> wide_id; 504 base::win::ScopedCoMem<WCHAR> wide_id;
505 device->GetId(&wide_id); 505 device->GetId(&wide_id);
506 std::string id; 506 std::string id;
507 WideToUTF8(wide_id, wcslen(wide_id), &id); 507 base::WideToUTF8(wide_id, wcslen(wide_id), &id);
508 found_a_pair = !CoreAudioUtil::GetMatchingOutputDeviceID(id).empty(); 508 found_a_pair = !CoreAudioUtil::GetMatchingOutputDeviceID(id).empty();
509 } 509 }
510 510
511 EXPECT_TRUE(found_a_pair); 511 EXPECT_TRUE(found_a_pair);
512 } 512 }
513 513
514 TEST_F(CoreAudioUtilWinTest, GetDefaultOutputDeviceID) { 514 TEST_F(CoreAudioUtilWinTest, GetDefaultOutputDeviceID) {
515 if (!CanRunAudioTest()) 515 if (!CanRunAudioTest())
516 return; 516 return;
517 517
518 std::string default_device_id(CoreAudioUtil::GetDefaultOutputDeviceID()); 518 std::string default_device_id(CoreAudioUtil::GetDefaultOutputDeviceID());
519 EXPECT_FALSE(default_device_id.empty()); 519 EXPECT_FALSE(default_device_id.empty());
520 } 520 }
521 521
522 } // namespace media 522 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/core_audio_util_win.cc ('k') | media/audio/win/device_enumeration_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698