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

Side by Side Diff: chrome/test/ui/omnibox_uitest.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 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 | « chrome/test/ui/inspector_controller_uitest.cc ('k') | chrome/test/ui/sandbox_uitests.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/perftimer.h" 10 #include "base/perftimer.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // done with the provider information. 126 // done with the provider information.
127 // <omnibox_tests> 127 // <omnibox_tests>
128 // Zero or more test elements. 128 // Zero or more test elements.
129 // <test query='%query%'> 129 // <test query='%query%'>
130 // Zero or more provider elements. 130 // Zero or more provider elements.
131 // <provider name='%expected_provider_name%'/> 131 // <provider name='%expected_provider_name%'/>
132 // </test> 132 // </test>
133 // </omnibox_tests> 133 // </omnibox_tests>
134 134
135 TEST_F(OmniboxTest, Measure) { 135 TEST_F(OmniboxTest, Measure) {
136 if (!CommandLine().HasSwitch(kRunOmniboxTest)) return; 136 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunOmniboxTest))
137 return;
137 138
138 std::wstring omnibox_tests_path; 139 std::wstring omnibox_tests_path;
139 PathService::Get(chrome::DIR_TEST_DATA, &omnibox_tests_path); 140 PathService::Get(chrome::DIR_TEST_DATA, &omnibox_tests_path);
140 file_util::AppendToPath(&omnibox_tests_path, L"omnibox_tests.xml"); 141 file_util::AppendToPath(&omnibox_tests_path, L"omnibox_tests.xml");
141 142
142 XmlReader reader; 143 XmlReader reader;
143 ASSERT_TRUE(reader.LoadFile(WideToASCII(omnibox_tests_path))); 144 ASSERT_TRUE(reader.LoadFile(WideToASCII(omnibox_tests_path)));
144 while (reader.SkipToElement()) { 145 while (reader.SkipToElement()) {
145 ASSERT_EQ("omnibox_tests", reader.NodeName()); 146 ASSERT_EQ("omnibox_tests", reader.NodeName());
146 reader.Read(); 147 reader.Read();
(...skipping 23 matching lines...) Expand all
170 wprintf(L"__om_query_timeouts = %d\n", query_timeouts_); 171 wprintf(L"__om_query_timeouts = %d\n", query_timeouts_);
171 wprintf(L"__om_time_per_query_avg = %d\n", mean); 172 wprintf(L"__om_time_per_query_avg = %d\n", mean);
172 // Use the equation stddev = sqrt(Sum(x_i^2)/N - mean^2). 173 // Use the equation stddev = sqrt(Sum(x_i^2)/N - mean^2).
173 wprintf(L"__om_time_per_query_stddev = %d\n", static_cast<int64>( 174 wprintf(L"__om_time_per_query_stddev = %d\n", static_cast<int64>(
174 sqrt(1.0 * time_squared_ / query_count_ - mean * mean))); 175 sqrt(1.0 * time_squared_ / query_count_ - mean * mean)));
175 wprintf(L"__om_time_per_query_max = %d\n", time_max_); 176 wprintf(L"__om_time_per_query_max = %d\n", time_max_);
176 wprintf(L"__om_time_per_query_min = %d\n", time_min_); 177 wprintf(L"__om_time_per_query_min = %d\n", time_min_);
177 wprintf(L"__om_score = %.4f\n", 100.0 * score_ / max_score_); 178 wprintf(L"__om_score = %.4f\n", 100.0 * score_ / max_score_);
178 } 179 }
179 180
OLDNEW
« no previous file with comments | « chrome/test/ui/inspector_controller_uitest.cc ('k') | chrome/test/ui/sandbox_uitests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698