| 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/remote/ntp_snippets_database.h" | 5 #include "components/ntp_snippets/remote/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 27 matching lines...) Expand all Loading... |
| 38 lhs.publish_date() == rhs.publish_date() && | 38 lhs.publish_date() == rhs.publish_date() && |
| 39 lhs.expiry_date() == rhs.expiry_date() && | 39 lhs.expiry_date() == rhs.expiry_date() && |
| 40 lhs.source_index() == rhs.source_index() && | 40 lhs.source_index() == rhs.source_index() && |
| 41 lhs.sources() == rhs.sources() && lhs.score() == rhs.score() && | 41 lhs.sources() == rhs.sources() && lhs.score() == rhs.score() && |
| 42 lhs.is_dismissed() == rhs.is_dismissed(); | 42 lhs.is_dismissed() == rhs.is_dismissed(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| 47 std::unique_ptr<NTPSnippet> CreateTestSnippet() { | 47 std::unique_ptr<NTPSnippet> CreateTestSnippet() { |
| 48 std::unique_ptr<NTPSnippet> snippet(new NTPSnippet("http://localhost")); | 48 std::unique_ptr<NTPSnippet> snippet(new NTPSnippet("http://localhost", 1)); |
| 49 snippet->add_source( | 49 snippet->add_source( |
| 50 SnippetSource(GURL("http://localhost"), "Publisher", GURL("http://amp"))); | 50 SnippetSource(GURL("http://localhost"), "Publisher", GURL("http://amp"))); |
| 51 return snippet; | 51 return snippet; |
| 52 } | 52 } |
| 53 | 53 |
| 54 MATCHER_P(SnippetEq, snippet, "") { | 54 MATCHER_P(SnippetEq, snippet, "") { |
| 55 return *arg == *snippet; | 55 return *arg == *snippet; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 base::RunLoop().RunUntilIdle(); | 361 base::RunLoop().RunUntilIdle(); |
| 362 | 362 |
| 363 // Make sure the images are gone. | 363 // Make sure the images are gone. |
| 364 LoadExpectedImage(db(), "snippet-id-1", ""); | 364 LoadExpectedImage(db(), "snippet-id-1", ""); |
| 365 LoadExpectedImage(db(), "snippet-id-3", ""); | 365 LoadExpectedImage(db(), "snippet-id-3", ""); |
| 366 // Make sure the second still exists. | 366 // Make sure the second still exists. |
| 367 LoadExpectedImage(db(), "snippet-id-2", "pretty-image-2"); | 367 LoadExpectedImage(db(), "snippet-id-2", "pretty-image-2"); |
| 368 } | 368 } |
| 369 | 369 |
| 370 } // namespace ntp_snippets | 370 } // namespace ntp_snippets |
| OLD | NEW |