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

Side by Side Diff: content/browser/webrtc/webrtc_getusermedia_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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 EXPECT_EQ(value->GetType(), base::Value::Type::LIST); 243 EXPECT_EQ(value->GetType(), base::Value::Type::LIST);
244 244
245 base::ListValue* values; 245 base::ListValue* values;
246 ASSERT_TRUE(value->GetAsList(&values)); 246 ASSERT_TRUE(value->GetAsList(&values));
247 247
248 for (base::ListValue::iterator it = values->begin(); 248 for (base::ListValue::iterator it = values->begin();
249 it != values->end(); ++it) { 249 it != values->end(); ++it) {
250 const base::DictionaryValue* dict; 250 const base::DictionaryValue* dict;
251 std::string kind; 251 std::string kind;
252 std::string device_id; 252 std::string device_id;
253 ASSERT_TRUE(it->GetAsDictionary(&dict)); 253 ASSERT_TRUE((*it)->GetAsDictionary(&dict));
254 ASSERT_TRUE(dict->GetString("kind", &kind)); 254 ASSERT_TRUE(dict->GetString("kind", &kind));
255 ASSERT_TRUE(dict->GetString("id", &device_id)); 255 ASSERT_TRUE(dict->GetString("id", &device_id));
256 ASSERT_FALSE(device_id.empty()); 256 ASSERT_FALSE(device_id.empty());
257 EXPECT_TRUE(kind == "audio" || kind == "video"); 257 EXPECT_TRUE(kind == "audio" || kind == "video");
258 if (kind == "audio") { 258 if (kind == "audio") {
259 audio_ids->push_back(device_id); 259 audio_ids->push_back(device_id);
260 } else if (kind == "video") { 260 } else if (kind == "video") {
261 video_ids->push_back(device_id); 261 video_ids->push_back(device_id);
262 } 262 }
263 } 263 }
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 EXPECT_EQ(value->GetType(), base::Value::Type::LIST); 933 EXPECT_EQ(value->GetType(), base::Value::Type::LIST);
934 934
935 base::ListValue* values; 935 base::ListValue* values;
936 ASSERT_TRUE(value->GetAsList(&values)); 936 ASSERT_TRUE(value->GetAsList(&values));
937 937
938 for (base::ListValue::iterator it = values->begin(); it != values->end(); 938 for (base::ListValue::iterator it = values->begin(); it != values->end();
939 ++it) { 939 ++it) {
940 const base::DictionaryValue* dict; 940 const base::DictionaryValue* dict;
941 std::string kind; 941 std::string kind;
942 std::string device_id; 942 std::string device_id;
943 ASSERT_TRUE(it->GetAsDictionary(&dict)); 943 ASSERT_TRUE((*it)->GetAsDictionary(&dict));
944 ASSERT_TRUE(dict->GetString("kind", &kind)); 944 ASSERT_TRUE(dict->GetString("kind", &kind));
945 ASSERT_TRUE(dict->GetString("id", &device_id)); 945 ASSERT_TRUE(dict->GetString("id", &device_id));
946 ASSERT_FALSE(device_id.empty()); 946 ASSERT_FALSE(device_id.empty());
947 EXPECT_TRUE(kind == "audio" || kind == "video"); 947 EXPECT_TRUE(kind == "audio" || kind == "video");
948 if (kind == "audio") { 948 if (kind == "audio") {
949 audio_ids->push_back(device_id); 949 audio_ids->push_back(device_id);
950 } else if (kind == "video") { 950 } else if (kind == "video") {
951 video_ids->push_back(device_id); 951 video_ids->push_back(device_id);
952 } 952 }
953 } 953 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 base::Bind(&VerifyDisableLocalEcho, true)); 1444 base::Bind(&VerifyDisableLocalEcho, true));
1445 call = GenerateGetUserMediaWithDisableLocalEcho( 1445 call = GenerateGetUserMediaWithDisableLocalEcho(
1446 "getUserMediaAndExpectSuccess", "true"); 1446 "getUserMediaAndExpectSuccess", "true");
1447 ExecuteJavascriptAndWaitForOk(call); 1447 ExecuteJavascriptAndWaitForOk(call);
1448 1448
1449 manager->SetGenerateStreamCallbackForTesting( 1449 manager->SetGenerateStreamCallbackForTesting(
1450 MediaStreamManager::GenerateStreamTestCallback()); 1450 MediaStreamManager::GenerateStreamTestCallback());
1451 } 1451 }
1452 1452
1453 } // namespace content 1453 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/tracing/background_tracing_config_impl.cc ('k') | content/browser/webrtc/webrtc_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698