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 #include "components/history/core/browser/top_sites_impl.h" | 5 #include "components/history/core/browser/top_sites_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/prefs/pref_registry_simple.h" |
| 16 #include "base/prefs/testing_pref_service.h" |
15 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
16 #include "base/task/cancelable_task_tracker.h" | 18 #include "base/task/cancelable_task_tracker.h" |
17 #include "build/build_config.h" | 19 #include "build/build_config.h" |
18 #include "components/history/core/browser/history_client.h" | 20 #include "components/history/core/browser/history_client.h" |
19 #include "components/history/core/browser/history_constants.h" | 21 #include "components/history/core/browser/history_constants.h" |
20 #include "components/history/core/browser/history_database_params.h" | 22 #include "components/history/core/browser/history_database_params.h" |
21 #include "components/history/core/browser/history_db_task.h" | 23 #include "components/history/core/browser/history_db_task.h" |
22 #include "components/history/core/browser/history_types.h" | 24 #include "components/history/core/browser/history_types.h" |
23 #include "components/history/core/browser/top_sites.h" | 25 #include "components/history/core/browser/top_sites.h" |
24 #include "components/history/core/browser/top_sites_cache.h" | 26 #include "components/history/core/browser/top_sites_cache.h" |
25 #include "components/history/core/browser/top_sites_observer.h" | 27 #include "components/history/core/browser/top_sites_observer.h" |
26 #include "components/history/core/browser/visit_delegate.h" | 28 #include "components/history/core/browser/visit_delegate.h" |
27 #include "components/history/core/test/history_unittest_base.h" | 29 #include "components/history/core/test/history_unittest_base.h" |
28 #include "components/history/core/test/test_history_database.h" | 30 #include "components/history/core/test/test_history_database.h" |
29 #include "components/history/core/test/wait_top_sites_loaded_observer.h" | 31 #include "components/history/core/test/wait_top_sites_loaded_observer.h" |
30 #include "components/prefs/pref_registry_simple.h" | |
31 #include "components/prefs/testing_pref_service.h" | |
32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
33 #include "third_party/skia/include/core/SkBitmap.h" | 33 #include "third_party/skia/include/core/SkBitmap.h" |
34 #include "url/gurl.h" | 34 #include "url/gurl.h" |
35 | 35 |
36 namespace history { | 36 namespace history { |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 // Key for URL blacklist. | 40 // Key for URL blacklist. |
41 const char kAcceptLanguages[] = "en-US,en"; | 41 const char kAcceptLanguages[] = "en-US,en"; |
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 EXPECT_EQ("http://forced/5", querier.urls()[5].url.spec()); | 1658 EXPECT_EQ("http://forced/5", querier.urls()[5].url.spec()); |
1659 EXPECT_EQ(6000u, querier.urls()[5].last_forced_time.ToJsTime()); | 1659 EXPECT_EQ(6000u, querier.urls()[5].last_forced_time.ToJsTime()); |
1660 scoped_refptr<base::RefCountedMemory> thumbnail_data; | 1660 scoped_refptr<base::RefCountedMemory> thumbnail_data; |
1661 ASSERT_TRUE(top_sites()->GetPageThumbnail(GURL("http://forced/5"), false, | 1661 ASSERT_TRUE(top_sites()->GetPageThumbnail(GURL("http://forced/5"), false, |
1662 &thumbnail_data)); | 1662 &thumbnail_data)); |
1663 ASSERT_TRUE( | 1663 ASSERT_TRUE( |
1664 ThumbnailsAreEqual(orig_thumbnail_data.get(), thumbnail_data.get())); | 1664 ThumbnailsAreEqual(orig_thumbnail_data.get(), thumbnail_data.get())); |
1665 } | 1665 } |
1666 | 1666 |
1667 } // namespace history | 1667 } // namespace history |
OLD | NEW |