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

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

Issue 109043002: Move more file_util functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/nix/mime_util_xdg.cc ('k') | base/test/launcher/test_results_tracker.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/launcher/test_launcher.h" 10 #include "base/test/launcher/test_launcher.h"
(...skipping 15 matching lines...) Expand all
26 26
27 } // namespace 27 } // namespace
28 28
29 XmlUnitTestResultPrinter::XmlUnitTestResultPrinter() : output_file_(NULL) { 29 XmlUnitTestResultPrinter::XmlUnitTestResultPrinter() : output_file_(NULL) {
30 } 30 }
31 31
32 XmlUnitTestResultPrinter::~XmlUnitTestResultPrinter() { 32 XmlUnitTestResultPrinter::~XmlUnitTestResultPrinter() {
33 if (output_file_) { 33 if (output_file_) {
34 fprintf(output_file_, "</testsuites>\n"); 34 fprintf(output_file_, "</testsuites>\n");
35 fflush(output_file_); 35 fflush(output_file_);
36 file_util::CloseFile(output_file_); 36 base::CloseFile(output_file_);
37 } 37 }
38 } 38 }
39 39
40 bool XmlUnitTestResultPrinter::Initialize(const FilePath& output_file_path) { 40 bool XmlUnitTestResultPrinter::Initialize(const FilePath& output_file_path) {
41 DCHECK(!output_file_); 41 DCHECK(!output_file_);
42 output_file_ = file_util::OpenFile(output_file_path, "w"); 42 output_file_ = OpenFile(output_file_path, "w");
43 if (!output_file_) 43 if (!output_file_)
44 return false; 44 return false;
45 45
46 fprintf(output_file_, 46 fprintf(output_file_,
47 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<testsuites>\n"); 47 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<testsuites>\n");
48 fflush(output_file_); 48 fflush(output_file_);
49 49
50 return true; 50 return true;
51 } 51 }
52 52
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // format. 219 // format.
220 return false; 220 return false;
221 } 221 }
222 } 222 }
223 223
224 *crashed = (state != STATE_END); 224 *crashed = (state != STATE_END);
225 return true; 225 return true;
226 } 226 }
227 227
228 } // namespace base 228 } // namespace base
OLDNEW
« no previous file with comments | « base/nix/mime_util_xdg.cc ('k') | base/test/launcher/test_results_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698