Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1464)

Unified Diff: components/ntp_snippets/offline_pages/offline_pages_test_utils.h

Issue 2360263002: [NTPSnippets] Show all downloads on the NTP (3/3): Downloads provider. (Closed)
Patch Set: the freshest rebase. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/offline_pages/offline_pages_test_utils.h
diff --git a/components/ntp_snippets/offline_pages/offline_pages_test_utils.h b/components/ntp_snippets/offline_pages/offline_pages_test_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f60a9d716888c93b7f16de0827e33c1d39cf0bd
--- /dev/null
+++ b/components/ntp_snippets/offline_pages/offline_pages_test_utils.h
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGES_TEST_UTILS_H_
+#define COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGES_TEST_UTILS_H_
+
+#include "components/ntp_snippets/content_suggestion.h"
+#include "components/offline_pages/offline_page_item.h"
+#include "components/offline_pages/stub_offline_page_model.h"
+
+namespace ntp_snippets {
+namespace test {
+
+class FakeOfflinePageModel : public offline_pages::StubOfflinePageModel {
+ public:
+ FakeOfflinePageModel();
+ ~FakeOfflinePageModel() override;
+
+ void GetAllPages(
+ const offline_pages::MultipleOfflinePageItemCallback& callback) override;
+
+ const std::vector<offline_pages::OfflinePageItem>& items();
+ std::vector<offline_pages::OfflinePageItem>* mutable_items();
+
+ private:
+ std::vector<offline_pages::OfflinePageItem> items_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeOfflinePageModel);
+};
+
+offline_pages::OfflinePageItem CreateDummyOfflinePageItem(
+ int id,
+ const std::string& name_space);
+
+void CaptureDismissedSuggestions(
+ std::vector<ntp_snippets::ContentSuggestion>* captured_suggestions,
+ std::vector<ntp_snippets::ContentSuggestion> dismissed_suggestions);
+
+} // namespace test
+} // namespace ntp_snippets
+
+#endif // COMPONENTS_NTP_SNIPPETS_OFFLINE_PAGES_OFFLINE_PAGES_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698