| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ntp_snippets/ntp_snippets_database.h" | 5 #include "components/ntp_snippets/ntp_snippets_database.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool operator==(const NTPSnippet& lhs, const NTPSnippet& rhs) { | 32 bool operator==(const NTPSnippet& lhs, const NTPSnippet& rhs) { |
| 33 return lhs.id() == rhs.id() && lhs.title() == rhs.title() && | 33 return lhs.id() == rhs.id() && lhs.title() == rhs.title() && |
| 34 lhs.snippet() == rhs.snippet() && | 34 lhs.snippet() == rhs.snippet() && |
| 35 lhs.salient_image_url() == rhs.salient_image_url() && | 35 lhs.salient_image_url() == rhs.salient_image_url() && |
| 36 lhs.publish_date() == rhs.publish_date() && | 36 lhs.publish_date() == rhs.publish_date() && |
| 37 lhs.expiry_date() == rhs.expiry_date() && | 37 lhs.expiry_date() == rhs.expiry_date() && |
| 38 lhs.source_index() == rhs.source_index() && | 38 lhs.source_index() == rhs.source_index() && |
| 39 lhs.sources() == rhs.sources() && lhs.score() == rhs.score() && | 39 lhs.sources() == rhs.sources() && lhs.score() == rhs.score() && |
| 40 lhs.is_discarded() == rhs.is_discarded(); | 40 lhs.is_dismissed() == rhs.is_dismissed(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 std::unique_ptr<NTPSnippet> CreateTestSnippet() { | 45 std::unique_ptr<NTPSnippet> CreateTestSnippet() { |
| 46 std::unique_ptr<NTPSnippet> snippet(new NTPSnippet("http://localhost")); | 46 std::unique_ptr<NTPSnippet> snippet(new NTPSnippet("http://localhost")); |
| 47 snippet->add_source( | 47 snippet->add_source( |
| 48 SnippetSource(GURL("http://localhost"), "Publisher", GURL("http://amp"))); | 48 SnippetSource(GURL("http://localhost"), "Publisher", GURL("http://amp"))); |
| 49 return snippet; | 49 return snippet; |
| 50 } | 50 } |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 // Make sure the image is gone. | 281 // Make sure the image is gone. |
| 282 EXPECT_CALL(*this, OnImageLoaded(std::string())); | 282 EXPECT_CALL(*this, OnImageLoaded(std::string())); |
| 283 db()->LoadImage(snippet->id(), | 283 db()->LoadImage(snippet->id(), |
| 284 base::Bind(&NTPSnippetsDatabaseTest::OnImageLoaded, | 284 base::Bind(&NTPSnippetsDatabaseTest::OnImageLoaded, |
| 285 base::Unretained(this))); | 285 base::Unretained(this))); |
| 286 base::RunLoop().RunUntilIdle(); | 286 base::RunLoop().RunUntilIdle(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace ntp_snippets | 289 } // namespace ntp_snippets |
| OLD | NEW |