OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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" |
46 #include "chrome/browser/history/in_memory_history_backend.h" | 46 #include "chrome/browser/history/in_memory_history_backend.h" |
47 #include "chrome/browser/history/page_usage_data.h" | 47 #include "chrome/browser/history/page_usage_data.h" |
48 #include "chrome/common/chrome_paths.h" | 48 #include "chrome/common/chrome_paths.h" |
49 #include "chrome/common/notification_details.h" | 49 #include "chrome/common/notification_details.h" |
50 #include "chrome/common/notification_source.h" | 50 #include "chrome/common/notification_source.h" |
51 #include "chrome/common/thumbnail_score.h" | 51 #include "chrome/common/thumbnail_score.h" |
52 #include "chrome/tools/profiles/thumbnail-inl.h" | 52 #include "chrome/tools/profiles/thumbnail-inl.h" |
53 #include "gfx/codec/jpeg_codec.h" | |
54 #include "testing/gtest/include/gtest/gtest.h" | 53 #include "testing/gtest/include/gtest/gtest.h" |
55 #include "third_party/skia/include/core/SkBitmap.h" | 54 #include "third_party/skia/include/core/SkBitmap.h" |
| 55 #include "ui/gfx/codec/jpeg_codec.h" |
56 | 56 |
57 using base::Time; | 57 using base::Time; |
58 using base::TimeDelta; | 58 using base::TimeDelta; |
59 | 59 |
60 namespace history { | 60 namespace history { |
61 class HistoryTest; | 61 class HistoryTest; |
62 } | 62 } |
63 | 63 |
64 // Specialize RunnableMethodTraits for HistoryTest so we can create callbacks. | 64 // Specialize RunnableMethodTraits for HistoryTest so we can create callbacks. |
65 // None of these callbacks can outlast the test, so there is not need to retain | 65 // None of these callbacks can outlast the test, so there is not need to retain |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 history_service_ = history; | 851 history_service_ = history; |
852 history->ScheduleDBTask(task.get(), &request_consumer); | 852 history->ScheduleDBTask(task.get(), &request_consumer); |
853 request_consumer.CancelAllRequests(); | 853 request_consumer.CancelAllRequests(); |
854 CleanupHistoryService(); | 854 CleanupHistoryService(); |
855 // WARNING: history has now been deleted. | 855 // WARNING: history has now been deleted. |
856 history = NULL; | 856 history = NULL; |
857 ASSERT_FALSE(task->done_invoked); | 857 ASSERT_FALSE(task->done_invoked); |
858 } | 858 } |
859 | 859 |
860 } // namespace history | 860 } // namespace history |
OLD | NEW |