| 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/memory/scoped_temp_dir.h" | 8 #include "base/memory/scoped_temp_dir.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 medium_score)); | 1091 medium_score)); |
| 1092 // Store thumbnails for unknown (but valid) URLs temporarily - calls | 1092 // Store thumbnails for unknown (but valid) URLs temporarily - calls |
| 1093 // AddTemporaryThumbnail. | 1093 // AddTemporaryThumbnail. |
| 1094 EXPECT_TRUE(top_sites()->SetPageThumbnail(unknown_url, | 1094 EXPECT_TRUE(top_sites()->SetPageThumbnail(unknown_url, |
| 1095 thumbnail, | 1095 thumbnail, |
| 1096 medium_score)); | 1096 medium_score)); |
| 1097 | 1097 |
| 1098 // We shouldn't get the thumnail back though (the url isn't in to sites yet). | 1098 // We shouldn't get the thumnail back though (the url isn't in to sites yet). |
| 1099 scoped_refptr<RefCountedBytes> out; | 1099 scoped_refptr<RefCountedBytes> out; |
| 1100 EXPECT_FALSE(top_sites()->GetPageThumbnail(unknown_url, &out)); | 1100 EXPECT_FALSE(top_sites()->GetPageThumbnail(unknown_url, &out)); |
| 1101 // But we should be able to get the temporary page thumbnail score. |
| 1102 ThumbnailScore out_score; |
| 1103 EXPECT_TRUE(top_sites()->GetTemporaryPageThumbnailScore(unknown_url, |
| 1104 &out_score)); |
| 1105 EXPECT_TRUE(medium_score.Equals(out_score)); |
| 1101 | 1106 |
| 1102 std::vector<MostVisitedURL> list; | 1107 std::vector<MostVisitedURL> list; |
| 1103 | 1108 |
| 1104 MostVisitedURL mv; | 1109 MostVisitedURL mv; |
| 1105 mv.url = unknown_url; | 1110 mv.url = unknown_url; |
| 1106 mv.redirects.push_back(mv.url); | 1111 mv.redirects.push_back(mv.url); |
| 1107 mv.redirects.push_back(url1a); | 1112 mv.redirects.push_back(url1a); |
| 1108 mv.redirects.push_back(url1b); | 1113 mv.redirects.push_back(url1b); |
| 1109 list.push_back(mv); | 1114 list.push_back(mv); |
| 1110 | 1115 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 WaitForTopSites(); | 1334 WaitForTopSites(); |
| 1330 EXPECT_FALSE(IsTopSitesLoaded()); | 1335 EXPECT_FALSE(IsTopSitesLoaded()); |
| 1331 | 1336 |
| 1332 // Load history, which should make TopSites finish loading too. | 1337 // Load history, which should make TopSites finish loading too. |
| 1333 profile()->CreateHistoryService(false, false); | 1338 profile()->CreateHistoryService(false, false); |
| 1334 profile()->BlockUntilTopSitesLoaded(); | 1339 profile()->BlockUntilTopSitesLoaded(); |
| 1335 EXPECT_TRUE(IsTopSitesLoaded()); | 1340 EXPECT_TRUE(IsTopSitesLoaded()); |
| 1336 } | 1341 } |
| 1337 | 1342 |
| 1338 } // namespace history | 1343 } // namespace history |
| OLD | NEW |