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

Side by Side Diff: chrome/test/perf/rendering/latency_tests.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/perf/perf_test.cc ('k') | chrome/test/perf/rendering/throughput_tests.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 (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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 std::string GetModeString() { 146 std::string GetModeString() {
147 switch (mode_) { 147 switch (mode_) {
148 case kWebGL: 148 case kWebGL:
149 return "webgl"; 149 return "webgl";
150 case kWebGLThread: 150 case kWebGLThread:
151 return "webgl_thread"; 151 return "webgl_thread";
152 case kSoftware: 152 case kSoftware:
153 return "software"; 153 return "software";
154 default: 154 default:
155 NOTREACHED() << "invalid mode"; 155 NOTREACHED() << "invalid mode";
156 return ""; 156 return std::string();
157 } 157 }
158 } 158 }
159 159
160 std::string GetTraceName(int flags); 160 std::string GetTraceName(int flags);
161 161
162 std::string GetUrlModeString(int flags); 162 std::string GetUrlModeString(int flags);
163 163
164 std::string GetUrl(int flags); 164 std::string GetUrl(int flags);
165 165
166 void GetMeanFrameTimeMicros(int* frame_time) const; 166 void GetMeanFrameTimeMicros(int* frame_time) const;
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 579
580 double mean_error = 0.0; 580 double mean_error = 0.0;
581 for (size_t i = 0; i < num_consider; ++i) { 581 for (size_t i = 0; i < num_consider; ++i) {
582 double offset = fabs(mean_latency - latencies[i]); 582 double offset = fabs(mean_latency - latencies[i]);
583 mean_error = (offset > mean_error) ? offset : mean_error; 583 mean_error = (offset > mean_error) ? offset : mean_error;
584 } 584 }
585 585
586 std::string trace_name = GetTraceName(test_flags_); 586 std::string trace_name = GetTraceName(test_flags_);
587 std::string mean_and_error = base::StringPrintf("%f,%f", mean_latency, 587 std::string mean_and_error = base::StringPrintf("%f,%f", mean_latency,
588 mean_error); 588 mean_error);
589 perf_test::PrintResultMeanAndError(GetModeString(), "", trace_name, 589 perf_test::PrintResultMeanAndError(GetModeString(),
590 mean_and_error, "frames", true); 590 std::string(),
591 trace_name,
592 mean_and_error,
593 "frames",
594 true);
591 return mean_latency; 595 return mean_latency;
592 } 596 }
593 597
594 std::string LatencyTest::GetTraceName(int flags) { 598 std::string LatencyTest::GetTraceName(int flags) {
595 if (flags == 0) 599 if (flags == 0)
596 return "simple"; 600 return "simple";
597 std::string name; 601 std::string name;
598 if (flags & kInputHeavy) 602 if (flags & kInputHeavy)
599 name += "ih"; 603 name += "ih";
600 if (flags & kInputDirty) 604 if (flags & kInputDirty)
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 kInputHeavy | kInputDirty | kRafHeavy, \ 748 kInputHeavy | kInputDirty | kRafHeavy, \
745 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, \ 749 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, \
746 kInputDirty | kPaintHeavy, \ 750 kInputDirty | kPaintHeavy, \
747 kInputDirty | kRafHeavy | kPaintHeavy) 751 kInputDirty | kRafHeavy | kPaintHeavy)
748 752
749 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGL, LATENCY_SUITE_MODES()); 753 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGL, LATENCY_SUITE_MODES());
750 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGLThread, LATENCY_SUITE_MODES()); 754 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGLThread, LATENCY_SUITE_MODES());
751 INSTANTIATE_TEST_CASE_P(, LatencyTestSW, LATENCY_SUITE_MODES()); 755 INSTANTIATE_TEST_CASE_P(, LatencyTestSW, LATENCY_SUITE_MODES());
752 756
753 } // namespace 757 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/perf/perf_test.cc ('k') | chrome/test/perf/rendering/throughput_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698