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

Side by Side Diff: components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc

Issue 2663183002: [NTP::Cleanup] Store tab id as int in SnippetArticle. (Closed)
Patch Set: clean rebase. Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
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/offline_pages/recent_tab_suggestions_provider. h" 5 #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider. h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 21 matching lines...) Expand all
32 using testing::IsEmpty; 32 using testing::IsEmpty;
33 using testing::Mock; 33 using testing::Mock;
34 using testing::Property; 34 using testing::Property;
35 using testing::SizeIs; 35 using testing::SizeIs;
36 36
37 namespace ntp_snippets { 37 namespace ntp_snippets {
38 38
39 namespace { 39 namespace {
40 40
41 OfflinePageItem CreateDummyRecentTab(int id) { 41 OfflinePageItem CreateDummyRecentTab(int id) {
42 return test::CreateDummyOfflinePageItem(id, offline_pages::kLastNNamespace); 42 OfflinePageItem item =
43 test::CreateDummyOfflinePageItem(id, offline_pages::kLastNNamespace);
44 item.client_id.id = base::IntToString(id);
45 return item;
43 } 46 }
44 47
45 std::vector<OfflinePageItem> CreateDummyRecentTabs( 48 std::vector<OfflinePageItem> CreateDummyRecentTabs(
46 const std::vector<int>& ids) { 49 const std::vector<int>& ids) {
47 std::vector<OfflinePageItem> result; 50 std::vector<OfflinePageItem> result;
48 for (int id : ids) { 51 for (int id : ids) {
49 result.push_back(CreateDummyRecentTab(id)); 52 result.push_back(CreateDummyRecentTab(id));
50 } 53 }
51 return result; 54 return result;
52 } 55 }
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 *observer(), 330 *observer(),
328 OnNewSuggestions( 331 OnNewSuggestions(
329 _, recent_tabs_category(), 332 _, recent_tabs_category(),
330 UnorderedElementsAre( 333 UnorderedElementsAre(
331 Property(&ContentSuggestion::url, GURL("http://dummy.com/1")), 334 Property(&ContentSuggestion::url, GURL("http://dummy.com/1")),
332 Property(&ContentSuggestion::url, GURL("http://dummy.com/2"))))); 335 Property(&ContentSuggestion::url, GURL("http://dummy.com/2")))));
333 AddOfflinePageToModel(CreateDummyRecentTab(2)); 336 AddOfflinePageToModel(CreateDummyRecentTab(2));
334 } 337 }
335 338
336 } // namespace ntp_snippets 339 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698