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

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

Issue 6354005: Remove action_max_timeout_ms and fix all the callers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/ui/npapi_uitest.cc ('k') | chrome/test/ui/pepper_uitest.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) 2011 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 <math.h> 5 #include <math.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/perftimer.h" 11 #include "base/perftimer.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/test/test_timeouts.h"
13 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
14 #include "chrome/app/chrome_command_ids.h" 15 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/common/chrome_paths.h" 16 #include "chrome/common/chrome_paths.h"
16 #include "chrome/common/libxml_utils.h" 17 #include "chrome/common/libxml_utils.h"
17 #include "chrome/test/automation/autocomplete_edit_proxy.h" 18 #include "chrome/test/automation/autocomplete_edit_proxy.h"
18 #include "chrome/test/automation/automation_proxy.h" 19 #include "chrome/test/automation/automation_proxy.h"
19 #include "chrome/test/automation/browser_proxy.h" 20 #include "chrome/test/automation/browser_proxy.h"
20 #include "chrome/test/automation/window_proxy.h" 21 #include "chrome/test/automation/window_proxy.h"
21 #include "chrome/test/ui/ui_test.h" 22 #include "chrome/test/ui/ui_test.h"
22 23
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 87
87 // Try every proper prefix of input_text. There's no use trying 88 // Try every proper prefix of input_text. There's no use trying
88 // input_text itself since the autocomplete results will always contain it. 89 // input_text itself since the autocomplete results will always contain it.
89 for (size_t i = 1; i < input_text.size(); ++i) { 90 for (size_t i = 1; i < input_text.size(); ++i) {
90 Matches matches; 91 Matches matches;
91 92
92 // We're only going to count the time elapsed waiting for autocomplete 93 // We're only going to count the time elapsed waiting for autocomplete
93 // matches to be returned to us. 94 // matches to be returned to us.
94 ASSERT_TRUE(autocomplete_edit->SetText(input_text.substr(0, i))); 95 ASSERT_TRUE(autocomplete_edit->SetText(input_text.substr(0, i)));
95 PerfTimer timer; 96 PerfTimer timer;
96 if (autocomplete_edit->WaitForQuery(action_max_timeout_ms())) { 97 if (autocomplete_edit->WaitForQuery(
98 TestTimeouts::action_max_timeout_ms())) {
97 ASSERT_TRUE(autocomplete_edit->GetAutocompleteMatches(&matches)); 99 ASSERT_TRUE(autocomplete_edit->GetAutocompleteMatches(&matches));
98 int64 time_elapsed = timer.Elapsed().InMilliseconds(); 100 int64 time_elapsed = timer.Elapsed().InMilliseconds();
99 101
100 // Adjust statistic trackers. 102 // Adjust statistic trackers.
101 if (query_count_ == 0) 103 if (query_count_ == 0)
102 time_min_ = time_max_ = time_elapsed; 104 time_min_ = time_max_ = time_elapsed;
103 ++query_count_; 105 ++query_count_;
104 time_squared_ += time_elapsed * time_elapsed; 106 time_squared_ += time_elapsed * time_elapsed;
105 time_sum_ += time_elapsed; 107 time_sum_ += time_elapsed;
106 if (time_elapsed < time_min_) 108 if (time_elapsed < time_min_)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 wprintf(L"__om_query_count = %d\n", query_count_); 175 wprintf(L"__om_query_count = %d\n", query_count_);
174 wprintf(L"__om_query_timeouts = %d\n", query_timeouts_); 176 wprintf(L"__om_query_timeouts = %d\n", query_timeouts_);
175 wprintf(L"__om_time_per_query_avg = %d\n", mean); 177 wprintf(L"__om_time_per_query_avg = %d\n", mean);
176 // Use the equation stddev = sqrt(Sum(x_i^2)/N - mean^2). 178 // Use the equation stddev = sqrt(Sum(x_i^2)/N - mean^2).
177 wprintf(L"__om_time_per_query_stddev = %d\n", static_cast<int64>( 179 wprintf(L"__om_time_per_query_stddev = %d\n", static_cast<int64>(
178 sqrt(1.0 * time_squared_ / query_count_ - mean * mean))); 180 sqrt(1.0 * time_squared_ / query_count_ - mean * mean)));
179 wprintf(L"__om_time_per_query_max = %d\n", time_max_); 181 wprintf(L"__om_time_per_query_max = %d\n", time_max_);
180 wprintf(L"__om_time_per_query_min = %d\n", time_min_); 182 wprintf(L"__om_time_per_query_min = %d\n", time_min_);
181 wprintf(L"__om_score = %.4f\n", 100.0 * score_ / max_score_); 183 wprintf(L"__om_score = %.4f\n", 100.0 * score_ / max_score_);
182 } 184 }
OLDNEW
« no previous file with comments | « chrome/test/ui/npapi_uitest.cc ('k') | chrome/test/ui/pepper_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698