| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // Block here to make sure that all of them are complete. | 141 // Block here to make sure that all of them are complete. |
| 142 history::BlockUntilHistoryProcessesPendingRequests( | 142 history::BlockUntilHistoryProcessesPendingRequests( |
| 143 client_->GetHistoryService()); | 143 client_->GetHistoryService()); |
| 144 | 144 |
| 145 provider_ = new HistoryQuickProvider(client_.get()); | 145 provider_ = new HistoryQuickProvider(client_.get()); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void HQPPerfTestOnePopularURL::PrintMeasurements( | 148 void HQPPerfTestOnePopularURL::PrintMeasurements( |
| 149 const std::string& trace_name, | 149 const std::string& trace_name, |
| 150 const std::vector<base::TimeDelta>& measurements) { | 150 const std::vector<base::TimeDelta>& measurements) { |
| 151 auto test_info = ::testing::UnitTest::GetInstance()->current_test_info(); | 151 auto* test_info = ::testing::UnitTest::GetInstance()->current_test_info(); |
| 152 | 152 |
| 153 std::string durations; | 153 std::string durations; |
| 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) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 RunAllTests(prefixes.begin(), prefixes.end()); | 204 RunAllTests(prefixes.begin(), prefixes.end()); |
| 205 } | 205 } |
| 206 | 206 |
| 207 TEST_F(HQPPerfTestOnePopularURL, Backspacing) { | 207 TEST_F(HQPPerfTestOnePopularURL, Backspacing) { |
| 208 std::string test_url = GeneratePopularURLRow().url().spec(); | 208 std::string test_url = GeneratePopularURLRow().url().spec(); |
| 209 StringPieces prefixes = AllPrefixes(test_url); | 209 StringPieces prefixes = AllPrefixes(test_url); |
| 210 RunAllTests(prefixes.rbegin(), prefixes.rend()); | 210 RunAllTests(prefixes.rbegin(), prefixes.rend()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace history | 213 } // namespace history |
| OLD | NEW |