OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // History unit tests come in two flavors: | 5 // History unit tests come in two flavors: |
6 // | 6 // |
7 // 1. The more complicated style is that the unit test creates a full history | 7 // 1. The more complicated style is that the unit test creates a full history |
8 // service. This spawns a background thread for the history backend, and | 8 // service. This spawns a background thread for the history backend, and |
9 // all communication is asynchronous. This is useful for testing more | 9 // all communication is asynchronous. This is useful for testing more |
10 // complicated things or end-to-end behavior. | 10 // complicated things or end-to-end behavior. |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "base/file_util.h" | 31 #include "base/file_util.h" |
32 #include "base/files/file_path.h" | 32 #include "base/files/file_path.h" |
33 #include "base/files/scoped_temp_dir.h" | 33 #include "base/files/scoped_temp_dir.h" |
34 #include "base/logging.h" | 34 #include "base/logging.h" |
35 #include "base/memory/scoped_ptr.h" | 35 #include "base/memory/scoped_ptr.h" |
36 #include "base/memory/scoped_vector.h" | 36 #include "base/memory/scoped_vector.h" |
37 #include "base/message_loop.h" | 37 #include "base/message_loop.h" |
38 #include "base/path_service.h" | 38 #include "base/path_service.h" |
39 #include "base/string_util.h" | 39 #include "base/string_util.h" |
40 #include "base/stringprintf.h" | 40 #include "base/stringprintf.h" |
| 41 #include "base/strings/utf_string_conversions.h" |
41 #include "base/threading/platform_thread.h" | 42 #include "base/threading/platform_thread.h" |
42 #include "base/time.h" | 43 #include "base/time.h" |
43 #include "base/utf_string_conversions.h" | |
44 #include "chrome/browser/history/download_row.h" | 44 #include "chrome/browser/history/download_row.h" |
45 #include "chrome/browser/history/history_backend.h" | 45 #include "chrome/browser/history/history_backend.h" |
46 #include "chrome/browser/history/history_database.h" | 46 #include "chrome/browser/history/history_database.h" |
47 #include "chrome/browser/history/history_db_task.h" | 47 #include "chrome/browser/history/history_db_task.h" |
48 #include "chrome/browser/history/history_notifications.h" | 48 #include "chrome/browser/history/history_notifications.h" |
49 #include "chrome/browser/history/history_service.h" | 49 #include "chrome/browser/history/history_service.h" |
50 #include "chrome/browser/history/history_unittest_base.h" | 50 #include "chrome/browser/history/history_unittest_base.h" |
51 #include "chrome/browser/history/in_memory_database.h" | 51 #include "chrome/browser/history/in_memory_database.h" |
52 #include "chrome/browser/history/in_memory_history_backend.h" | 52 #include "chrome/browser/history/in_memory_history_backend.h" |
53 #include "chrome/browser/history/page_usage_data.h" | 53 #include "chrome/browser/history/page_usage_data.h" |
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 std::vector<PageUsageData*> results; | 1658 std::vector<PageUsageData*> results; |
1659 db_->QuerySegmentUsage(segment_time, 10, &results); | 1659 db_->QuerySegmentUsage(segment_time, 10, &results); |
1660 ASSERT_EQ(1u, results.size()); | 1660 ASSERT_EQ(1u, results.size()); |
1661 EXPECT_EQ(url, results[0]->GetURL()); | 1661 EXPECT_EQ(url, results[0]->GetURL()); |
1662 EXPECT_EQ(segment_id, results[0]->GetID()); | 1662 EXPECT_EQ(segment_id, results[0]->GetID()); |
1663 EXPECT_EQ(title, results[0]->GetTitle()); | 1663 EXPECT_EQ(title, results[0]->GetTitle()); |
1664 STLDeleteElements(&results); | 1664 STLDeleteElements(&results); |
1665 } | 1665 } |
1666 | 1666 |
1667 } // namespace history | 1667 } // namespace history |
OLD | NEW |