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

Side by Side Diff: base/test/gtest_xml_util.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « base/sys_info_linux.cc ('k') | base/test/test_file_util_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_xml_util.h" 5 #include "base/test/gtest_xml_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/test/test_launcher.h" 10 #include "base/test/test_launcher.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 fprintf(output_file_, " </testsuite>\n"); 86 fprintf(output_file_, " </testsuite>\n");
87 fflush(output_file_); 87 fflush(output_file_);
88 } 88 }
89 89
90 bool ProcessGTestOutput(const base::FilePath& output_file, 90 bool ProcessGTestOutput(const base::FilePath& output_file,
91 std::vector<TestResult>* results, 91 std::vector<TestResult>* results,
92 bool* crashed) { 92 bool* crashed) {
93 DCHECK(results); 93 DCHECK(results);
94 94
95 std::string xml_contents; 95 std::string xml_contents;
96 if (!file_util::ReadFileToString(output_file, &xml_contents)) 96 if (!ReadFileToString(output_file, &xml_contents))
97 return false; 97 return false;
98 98
99 // Silence XML errors - otherwise they go to stderr. 99 // Silence XML errors - otherwise they go to stderr.
100 std::string xml_errors; 100 std::string xml_errors;
101 ScopedXmlErrorFunc error_func(&xml_errors, &XmlErrorFunc); 101 ScopedXmlErrorFunc error_func(&xml_errors, &XmlErrorFunc);
102 102
103 XmlReader xml_reader; 103 XmlReader xml_reader;
104 if (!xml_reader.Load(xml_contents)) 104 if (!xml_reader.Load(xml_contents))
105 return false; 105 return false;
106 106
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // format. 213 // format.
214 return false; 214 return false;
215 } 215 }
216 } 216 }
217 217
218 *crashed = (state != STATE_END); 218 *crashed = (state != STATE_END);
219 return true; 219 return true;
220 } 220 }
221 221
222 } // namespace base 222 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_linux.cc ('k') | base/test/test_file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698