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