| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/weak_ptr.h" | 6 #include "base/memory/weak_ptr.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/task/cancelable_task_tracker.h" | 9 #include "base/task/cancelable_task_tracker.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 base::Bind(&TopSitesImplTest::QuitCallback, base::Unretained(this)), | 233 base::Bind(&TopSitesImplTest::QuitCallback, base::Unretained(this)), |
| 234 &top_sites_tracker_); | 234 &top_sites_tracker_); |
| 235 base::MessageLoop::current()->Run(); | 235 base::MessageLoop::current()->Run(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 TopSitesImpl* top_sites() { | 238 TopSitesImpl* top_sites() { |
| 239 return static_cast<TopSitesImpl*>(profile_->GetTopSites()); | 239 return static_cast<TopSitesImpl*>(profile_->GetTopSites()); |
| 240 } | 240 } |
| 241 TestingProfile* profile() {return profile_.get();} | 241 TestingProfile* profile() {return profile_.get();} |
| 242 HistoryService* history_service() { | 242 HistoryService* history_service() { |
| 243 return HistoryServiceFactory::GetForProfile(profile_.get(), | 243 return HistoryServiceFactory::GetForProfile( |
| 244 Profile::EXPLICIT_ACCESS); | 244 profile_.get(), ServiceAccessType::EXPLICIT_ACCESS); |
| 245 } | 245 } |
| 246 | 246 |
| 247 MostVisitedURLList GetPrepopulatePages() { | 247 MostVisitedURLList GetPrepopulatePages() { |
| 248 return top_sites()->GetPrepopulatePages(); | 248 return top_sites()->GetPrepopulatePages(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 // Returns true if the TopSitesQuerier contains the prepopulate data starting | 251 // Returns true if the TopSitesQuerier contains the prepopulate data starting |
| 252 // at |start_index|. | 252 // at |start_index|. |
| 253 void ContainsPrepopulatePages(const TopSitesQuerier& querier, | 253 void ContainsPrepopulatePages(const TopSitesQuerier& querier, |
| 254 size_t start_index) { | 254 size_t start_index) { |
| (...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 ASSERT_EQ(orig_thumbnail.getSize(), thumbnail.getSize()); | 1682 ASSERT_EQ(orig_thumbnail.getSize(), thumbnail.getSize()); |
| 1683 orig_thumbnail.lockPixels(); | 1683 orig_thumbnail.lockPixels(); |
| 1684 thumbnail.lockPixels(); | 1684 thumbnail.lockPixels(); |
| 1685 EXPECT_EQ(0, memcmp(orig_thumbnail.getPixels(), thumbnail.getPixels(), | 1685 EXPECT_EQ(0, memcmp(orig_thumbnail.getPixels(), thumbnail.getPixels(), |
| 1686 orig_thumbnail.getSize())); | 1686 orig_thumbnail.getSize())); |
| 1687 thumbnail.unlockPixels(); | 1687 thumbnail.unlockPixels(); |
| 1688 orig_thumbnail.unlockPixels(); | 1688 orig_thumbnail.unlockPixels(); |
| 1689 } | 1689 } |
| 1690 | 1690 |
| 1691 } // namespace history | 1691 } // namespace history |
| OLD | NEW |