OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/omnibox/browser/history_quick_provider.h" | 5 #include "components/omnibox/browser/history_quick_provider.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <random> | 8 #include <random> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 for (const auto& measurement : measurements) | 155 for (const auto& measurement : measurements) |
156 durations += std::to_string(measurement.InMillisecondsRoundedUp()) + ','; | 156 durations += std::to_string(measurement.InMillisecondsRoundedUp()) + ','; |
157 | 157 |
158 perf_test::PrintResultList(test_info->test_case_name(), test_info->name(), | 158 perf_test::PrintResultList(test_info->test_case_name(), test_info->name(), |
159 trace_name, durations, "ms", true); | 159 trace_name, durations, "ms", true); |
160 } | 160 } |
161 | 161 |
162 base::TimeDelta HQPPerfTestOnePopularURL::RunTest(const base::string16& text) { | 162 base::TimeDelta HQPPerfTestOnePopularURL::RunTest(const base::string16& text) { |
163 base::RunLoop().RunUntilIdle(); | 163 base::RunLoop().RunUntilIdle(); |
164 AutocompleteInput input(text, base::string16::npos, std::string(), GURL(), | 164 AutocompleteInput input(text, base::string16::npos, std::string(), GURL(), |
| 165 base::string16(), |
165 metrics::OmniboxEventProto::INVALID_SPEC, false, | 166 metrics::OmniboxEventProto::INVALID_SPEC, false, |
166 false, true, true, false, TestSchemeClassifier()); | 167 false, true, true, false, TestSchemeClassifier()); |
167 | 168 |
168 if (base::ThreadTicks::IsSupported()) { | 169 if (base::ThreadTicks::IsSupported()) { |
169 base::ThreadTicks start = base::ThreadTicks::Now(); | 170 base::ThreadTicks start = base::ThreadTicks::Now(); |
170 provider_->Start(input, false); | 171 provider_->Start(input, false); |
171 return base::ThreadTicks::Now() - start; | 172 return base::ThreadTicks::Now() - start; |
172 } | 173 } |
173 | 174 |
174 base::Time start = base::Time::Now(); | 175 base::Time start = base::Time::Now(); |
(...skipping 30 matching lines...) Expand all Loading... |
205 RunAllTests(prefixes.begin(), prefixes.end()); | 206 RunAllTests(prefixes.begin(), prefixes.end()); |
206 } | 207 } |
207 | 208 |
208 TEST_F(HQPPerfTestOnePopularURL, Backspacing) { | 209 TEST_F(HQPPerfTestOnePopularURL, Backspacing) { |
209 std::string test_url = GeneratePopularURLRow().url().spec(); | 210 std::string test_url = GeneratePopularURLRow().url().spec(); |
210 StringPieces prefixes = AllPrefixes(test_url); | 211 StringPieces prefixes = AllPrefixes(test_url); |
211 RunAllTests(prefixes.rbegin(), prefixes.rend()); | 212 RunAllTests(prefixes.rbegin(), prefixes.rend()); |
212 } | 213 } |
213 | 214 |
214 } // namespace history | 215 } // namespace history |
OLD | NEW |