OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/webui/history_ui.h" | 5 #include "chrome/browser/ui/webui/history_ui.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 struct TestResult { | 12 struct TestResult { |
13 std::string url; | 13 std::string url; |
14 int64 hour_offset; // Visit time in hours past the baseline time. | 14 int64 hour_offset; // Visit time in hours past the baseline time. |
15 }; | 15 }; |
16 | 16 |
17 // Duplicates on the same day in the local timezone are removed, so set a | 17 // Duplicates on the same day in the local timezone are removed, so set a |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 AddQueryResults(test_data, arraysize(test_data), &results); | 121 AddQueryResults(test_data, arraysize(test_data), &results); |
122 BrowsingHistoryHandler::MergeDuplicateResults(&results); | 122 BrowsingHistoryHandler::MergeDuplicateResults(&results); |
123 | 123 |
124 ASSERT_EQ(2U, results.size()); | 124 ASSERT_EQ(2U, results.size()); |
125 EXPECT_TRUE(ResultEquals(results[0], test_data[3])); | 125 EXPECT_TRUE(ResultEquals(results[0], test_data[3])); |
126 EXPECT_TRUE(ResultEquals(results[1], test_data[1])); | 126 EXPECT_TRUE(ResultEquals(results[1], test_data[1])); |
127 EXPECT_EQ(3u, results[0].all_timestamps.size()); | 127 EXPECT_EQ(3u, results[0].all_timestamps.size()); |
128 EXPECT_EQ(1u, results[1].all_timestamps.size()); | 128 EXPECT_EQ(1u, results[1].all_timestamps.size()); |
129 } | 129 } |
130 } | 130 } |
OLD | NEW |