| Index: components/ntp_snippets/remote/ntp_snippets_service_unittest.cc
|
| diff --git a/components/ntp_snippets/remote/ntp_snippets_service_unittest.cc b/components/ntp_snippets/remote/ntp_snippets_service_unittest.cc
|
| index f18ceacfa67b6b9c87688fc1f8ec65591c1c3c79..b64ac1e92fded7df0295e8d6708d8a8a44fa3c7a 100644
|
| --- a/components/ntp_snippets/remote/ntp_snippets_service_unittest.cc
|
| +++ b/components/ntp_snippets/remote/ntp_snippets_service_unittest.cc
|
| @@ -780,6 +780,23 @@ TEST_F(NTPSnippetsServiceTest, PersistCategoryInfos) {
|
| EXPECT_EQ(info_unknown_before.title(), info_unknown_after.title());
|
| }
|
|
|
| +TEST_F(NTPSnippetsServiceTest, PersistSuggestions) {
|
| + auto service = MakeSnippetsService();
|
| +
|
| + LoadFromJSONString(service.get(),
|
| + GetMultiCategoryJson({GetSnippetN(0)}, {GetSnippetN(1)}));
|
| +
|
| + ASSERT_THAT(service->GetSnippetsForTesting(articles_category()), SizeIs(1));
|
| + ASSERT_THAT(service->GetSnippetsForTesting(other_category()), SizeIs(1));
|
| +
|
| + // Recreate the service to simulate a Chrome restart.
|
| + ResetSnippetsService(&service);
|
| +
|
| + // The suggestions in both categories should have been restored.
|
| + EXPECT_THAT(service->GetSnippetsForTesting(articles_category()), SizeIs(1));
|
| + EXPECT_THAT(service->GetSnippetsForTesting(other_category()), SizeIs(1));
|
| +}
|
| +
|
| TEST_F(NTPSnippetsServiceTest, Clear) {
|
| auto service = MakeSnippetsService();
|
|
|
|
|