OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 11 matching lines...) Expand all Loading... |
22 #include <algorithm> | 22 #include <algorithm> |
23 #include <string> | 23 #include <string> |
24 | 24 |
25 #include "app/sql/connection.h" | 25 #include "app/sql/connection.h" |
26 #include "app/sql/statement.h" | 26 #include "app/sql/statement.h" |
27 #include "base/basictypes.h" | 27 #include "base/basictypes.h" |
28 #include "base/callback.h" | 28 #include "base/callback.h" |
29 #include "base/command_line.h" | 29 #include "base/command_line.h" |
30 #include "base/file_path.h" | 30 #include "base/file_path.h" |
31 #include "base/file_util.h" | 31 #include "base/file_util.h" |
32 #include "base/memory/scoped_temp_dir.h" | |
33 #include "base/memory/scoped_vector.h" | 32 #include "base/memory/scoped_vector.h" |
34 #include "base/message_loop.h" | 33 #include "base/message_loop.h" |
35 #include "base/path_service.h" | 34 #include "base/path_service.h" |
| 35 #include "base/scoped_temp_dir.h" |
36 #include "base/string_util.h" | 36 #include "base/string_util.h" |
37 #include "base/task.h" | 37 #include "base/task.h" |
38 #include "base/utf_string_conversions.h" | 38 #include "base/utf_string_conversions.h" |
39 #include "chrome/browser/download/download_item.h" | 39 #include "chrome/browser/download/download_item.h" |
40 #include "chrome/browser/history/download_create_info.h" | 40 #include "chrome/browser/history/download_create_info.h" |
41 #include "chrome/browser/history/history.h" | 41 #include "chrome/browser/history/history.h" |
42 #include "chrome/browser/history/history_backend.h" | 42 #include "chrome/browser/history/history_backend.h" |
43 #include "chrome/browser/history/history_database.h" | 43 #include "chrome/browser/history/history_database.h" |
44 #include "chrome/browser/history/history_notifications.h" | 44 #include "chrome/browser/history/history_notifications.h" |
45 #include "chrome/browser/history/in_memory_database.h" | 45 #include "chrome/browser/history/in_memory_database.h" |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 history_service_ = history; | 849 history_service_ = history; |
850 history->ScheduleDBTask(task.get(), &request_consumer); | 850 history->ScheduleDBTask(task.get(), &request_consumer); |
851 request_consumer.CancelAllRequests(); | 851 request_consumer.CancelAllRequests(); |
852 CleanupHistoryService(); | 852 CleanupHistoryService(); |
853 // WARNING: history has now been deleted. | 853 // WARNING: history has now been deleted. |
854 history = NULL; | 854 history = NULL; |
855 ASSERT_FALSE(task->done_invoked); | 855 ASSERT_FALSE(task->done_invoked); |
856 } | 856 } |
857 | 857 |
858 } // namespace history | 858 } // namespace history |
OLD | NEW |