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

Side by Side Diff: base/test/gtest_util.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
« no previous file with comments | « base/json/json_writer.cc ('k') | base/trace_event/trace_event_argument.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 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/test/gtest_util.h" 5 #include "base/test/gtest_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (!value.get()) 78 if (!value.get())
79 return false; 79 return false;
80 80
81 base::ListValue* tests = nullptr; 81 base::ListValue* tests = nullptr;
82 if (!value->GetAsList(&tests)) 82 if (!value->GetAsList(&tests))
83 return false; 83 return false;
84 84
85 std::vector<base::TestIdentifier> result; 85 std::vector<base::TestIdentifier> result;
86 for (base::ListValue::iterator i = tests->begin(); i != tests->end(); ++i) { 86 for (base::ListValue::iterator i = tests->begin(); i != tests->end(); ++i) {
87 base::DictionaryValue* test = nullptr; 87 base::DictionaryValue* test = nullptr;
88 if (!i->GetAsDictionary(&test)) 88 if (!(*i)->GetAsDictionary(&test))
89 return false; 89 return false;
90 90
91 TestIdentifier test_data; 91 TestIdentifier test_data;
92 92
93 if (!test->GetStringASCII("test_case_name", &test_data.test_case_name)) 93 if (!test->GetStringASCII("test_case_name", &test_data.test_case_name))
94 return false; 94 return false;
95 95
96 if (!test->GetStringASCII("test_name", &test_data.test_name)) 96 if (!test->GetStringASCII("test_name", &test_data.test_name))
97 return false; 97 return false;
98 98
99 if (!test->GetStringASCII("file", &test_data.file)) 99 if (!test->GetStringASCII("file", &test_data.file))
100 return false; 100 return false;
101 101
102 if (!test->GetInteger("line", &test_data.line)) 102 if (!test->GetInteger("line", &test_data.line))
103 return false; 103 return false;
104 104
105 result.push_back(test_data); 105 result.push_back(test_data);
106 } 106 }
107 107
108 output->swap(result); 108 output->swap(result);
109 return true; 109 return true;
110 } 110 }
111 111
112 } // namespace base 112 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_writer.cc ('k') | base/trace_event/trace_event_argument.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698