| 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/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/task/cancelable_task_tracker.h" | 10 #include "base/task/cancelable_task_tracker.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "ui/gfx/codec/jpeg_codec.h" | 27 #include "ui/gfx/codec/jpeg_codec.h" |
| 28 #include "url/gurl.h" | 28 #include "url/gurl.h" |
| 29 | 29 |
| 30 using content::BrowserThread; | 30 using content::BrowserThread; |
| 31 | 31 |
| 32 class TestTopSitesObserver : public history::TopSitesObserver { | 32 class TestTopSitesObserver : public history::TopSitesObserver { |
| 33 public: | 33 public: |
| 34 explicit TestTopSitesObserver(Profile* profile, history::TopSites* top_sites); | 34 explicit TestTopSitesObserver(Profile* profile, history::TopSites* top_sites); |
| 35 virtual ~TestTopSitesObserver(); | 35 virtual ~TestTopSitesObserver(); |
| 36 // TopSitesObserver: | 36 // TopSitesObserver: |
| 37 virtual void TopSitesLoaded(history::TopSites* top_sites) OVERRIDE; | 37 virtual void TopSitesLoaded(history::TopSites* top_sites) override; |
| 38 virtual void TopSitesChanged(history::TopSites* top_sites) OVERRIDE; | 38 virtual void TopSitesChanged(history::TopSites* top_sites) override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 Profile* profile_; | 41 Profile* profile_; |
| 42 history::TopSites* top_sites_; | 42 history::TopSites* top_sites_; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 TestTopSitesObserver::~TestTopSitesObserver() { | 45 TestTopSitesObserver::~TestTopSitesObserver() { |
| 46 top_sites_->RemoveObserver(this); | 46 top_sites_->RemoveObserver(this); |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 70 namespace history { | 70 namespace history { |
| 71 | 71 |
| 72 namespace { | 72 namespace { |
| 73 | 73 |
| 74 // Used by WaitForHistory, see it for details. | 74 // Used by WaitForHistory, see it for details. |
| 75 class WaitForHistoryTask : public HistoryDBTask { | 75 class WaitForHistoryTask : public HistoryDBTask { |
| 76 public: | 76 public: |
| 77 WaitForHistoryTask() {} | 77 WaitForHistoryTask() {} |
| 78 | 78 |
| 79 virtual bool RunOnDBThread(HistoryBackend* backend, | 79 virtual bool RunOnDBThread(HistoryBackend* backend, |
| 80 HistoryDatabase* db) OVERRIDE { | 80 HistoryDatabase* db) override { |
| 81 return true; | 81 return true; |
| 82 } | 82 } |
| 83 | 83 |
| 84 virtual void DoneRunOnMainThread() OVERRIDE { | 84 virtual void DoneRunOnMainThread() override { |
| 85 base::MessageLoop::current()->Quit(); | 85 base::MessageLoop::current()->Quit(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 virtual ~WaitForHistoryTask() {} | 89 virtual ~WaitForHistoryTask() {} |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); | 91 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 // Used for querying top sites. Either runs sequentially, or runs a nested | 94 // Used for querying top sites. Either runs sequentially, or runs a nested |
| (...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1686 ASSERT_EQ(orig_thumbnail.getSize(), thumbnail.getSize()); | 1686 ASSERT_EQ(orig_thumbnail.getSize(), thumbnail.getSize()); |
| 1687 orig_thumbnail.lockPixels(); | 1687 orig_thumbnail.lockPixels(); |
| 1688 thumbnail.lockPixels(); | 1688 thumbnail.lockPixels(); |
| 1689 EXPECT_EQ(0, memcmp(orig_thumbnail.getPixels(), thumbnail.getPixels(), | 1689 EXPECT_EQ(0, memcmp(orig_thumbnail.getPixels(), thumbnail.getPixels(), |
| 1690 orig_thumbnail.getSize())); | 1690 orig_thumbnail.getSize())); |
| 1691 thumbnail.unlockPixels(); | 1691 thumbnail.unlockPixels(); |
| 1692 orig_thumbnail.unlockPixels(); | 1692 orig_thumbnail.unlockPixels(); |
| 1693 } | 1693 } |
| 1694 | 1694 |
| 1695 } // namespace history | 1695 } // namespace history |
| OLD | NEW |