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

Side by Side Diff: chrome/browser/media/webrtc/webrtc_getmediadevices_browsertest.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/json/json_reader.h" 6 #include "base/json/json_reader.h"
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" 8 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h"
9 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" 9 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 base::ListValue* values; 80 base::ListValue* values;
81 ASSERT_TRUE(value->GetAsList(&values)); 81 ASSERT_TRUE(value->GetAsList(&values));
82 ASSERT_FALSE(values->empty()); 82 ASSERT_FALSE(values->empty());
83 bool found_audio_input = false; 83 bool found_audio_input = false;
84 bool found_video_input = false; 84 bool found_video_input = false;
85 85
86 for (base::ListValue::iterator it = values->begin(); 86 for (base::ListValue::iterator it = values->begin();
87 it != values->end(); ++it) { 87 it != values->end(); ++it) {
88 const base::DictionaryValue* dict; 88 const base::DictionaryValue* dict;
89 MediaDeviceInfo device; 89 MediaDeviceInfo device;
90 ASSERT_TRUE(it->GetAsDictionary(&dict)); 90 ASSERT_TRUE((*it)->GetAsDictionary(&dict));
91 ASSERT_TRUE(dict->GetString("deviceId", &device.device_id)); 91 ASSERT_TRUE(dict->GetString("deviceId", &device.device_id));
92 ASSERT_TRUE(dict->GetString("kind", &device.kind)); 92 ASSERT_TRUE(dict->GetString("kind", &device.kind));
93 ASSERT_TRUE(dict->GetString("label", &device.label)); 93 ASSERT_TRUE(dict->GetString("label", &device.label));
94 ASSERT_TRUE(dict->GetString("groupId", &device.group_id)); 94 ASSERT_TRUE(dict->GetString("groupId", &device.group_id));
95 95
96 // Should be HMAC SHA256. 96 // Should be HMAC SHA256.
97 if (!media::AudioDeviceDescription::IsDefaultDevice(device.device_id) && 97 if (!media::AudioDeviceDescription::IsDefaultDevice(device.device_id) &&
98 !(device.device_id == 98 !(device.device_id ==
99 media::AudioDeviceDescription::kCommunicationsDeviceId)) { 99 media::AudioDeviceDescription::kCommunicationsDeviceId)) {
100 EXPECT_EQ(64ul, device.device_id.length()); 100 EXPECT_EQ(64ul, device.device_id.length());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 std::vector<MediaDeviceInfo> devices; 166 std::vector<MediaDeviceInfo> devices;
167 EnumerateDevices(tab, &devices); 167 EnumerateDevices(tab, &devices);
168 168
169 // Labels should be non-empty if access has been allowed. 169 // Labels should be non-empty if access has been allowed.
170 for (std::vector<MediaDeviceInfo>::iterator it = devices.begin(); 170 for (std::vector<MediaDeviceInfo>::iterator it = devices.begin();
171 it != devices.end(); ++it) { 171 it != devices.end(); ++it) {
172 EXPECT_TRUE(!it->label.empty()); 172 EXPECT_TRUE(!it->label.empty());
173 } 173 }
174 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698