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

Side by Side Diff: chrome/test/chromedriver/chrome/log.cc

Issue 16753002: Use a direct include of strings headers in chrome/test/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/test/chromedriver/logging.h" 12 #include "chrome/test/chromedriver/logging.h"
13 13
14 namespace { 14 namespace {
15 15
16 // Truncates the given string to 200 characters, adding an ellipsis if 16 // Truncates the given string to 200 characters, adding an ellipsis if
17 // truncation was necessary. 17 // truncation was necessary.
18 void TruncateString(std::string* data) { 18 void TruncateString(std::string* data) {
19 const size_t kMaxLength = 200; 19 const size_t kMaxLength = 200;
20 if (data->length() > kMaxLength) { 20 if (data->length() > kMaxLength) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 base::StringPrintf("[%.3lf][%s]: %s", 124 base::StringPrintf("[%.3lf][%s]: %s",
125 base::TimeDelta(timestamp - start_).InSecondsF(), 125 base::TimeDelta(timestamp - start_).InSecondsF(),
126 level_name, 126 level_name,
127 ConvertForDisplay(message).c_str()); 127 ConvertForDisplay(message).c_str());
128 const char* format = "%s\n"; 128 const char* format = "%s\n";
129 if (entry[entry.length() - 1] == '\n') 129 if (entry[entry.length() - 1] == '\n')
130 format = "%s"; 130 format = "%s";
131 fprintf(stderr, format, entry.c_str()); 131 fprintf(stderr, format, entry.c_str());
132 fflush(stderr); 132 fflush(stderr);
133 } 133 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome/devtools_http_client.cc ('k') | chrome/test/chromedriver/chrome/navigation_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698