| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 EXPECT_EQ(result_sites, expected_sites); | 78 EXPECT_EQ(result_sites, expected_sites); |
| 79 } | 79 } |
| 80 static scoped_ptr<MostVisitedSites::Suggestion> MakeSuggestionFrom( | 80 static scoped_ptr<MostVisitedSites::Suggestion> MakeSuggestionFrom( |
| 81 const TitleURL& title_url, | 81 const TitleURL& title_url, |
| 82 bool is_personal, | 82 bool is_personal, |
| 83 bool whitelist) { | 83 bool whitelist) { |
| 84 return make_scoped_ptr(new MostVisitedSites::Suggestion( | 84 return make_scoped_ptr(new MostVisitedSites::Suggestion( |
| 85 title_url.title, title_url.url, | 85 title_url.title, title_url.url, |
| 86 whitelist ? MostVisitedSites::WHITELIST | 86 whitelist ? MostVisitedSites::WHITELIST |
| 87 : (is_personal ? MostVisitedSites::TOP_SITES | 87 : (is_personal ? MostVisitedSites::TOP_SITES |
| 88 : MostVisitedSites::POPULAR))); | 88 : MostVisitedSites::POPULAR), |
| 89 base::FilePath())); |
| 89 } | 90 } |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 TEST_F(MostVisitedSitesTest, PersonalSitesDefaultOrder) { | 93 TEST_F(MostVisitedSitesTest, PersonalSitesDefaultOrder) { |
| 93 TitleURL personal[] = { | 94 TitleURL personal[] = { |
| 94 TitleURL("Site 1", "https://www.site1.com/"), | 95 TitleURL("Site 1", "https://www.site1.com/"), |
| 95 TitleURL("Site 2", "https://www.site2.com/"), | 96 TitleURL("Site 2", "https://www.site2.com/"), |
| 96 TitleURL("Site 3", "https://www.site3.com/"), | 97 TitleURL("Site 3", "https://www.site3.com/"), |
| 97 TitleURL("Site 4", "https://www.site4.com/"), | 98 TitleURL("Site 4", "https://www.site4.com/"), |
| 98 }; | 99 }; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 bool expected_source_is_personal[] = {false, true, true, false}; | 228 bool expected_source_is_personal[] = {false, true, true, false}; |
| 228 Check(std::vector<TitleURL>(popular, popular + arraysize(popular)), | 229 Check(std::vector<TitleURL>(popular, popular + arraysize(popular)), |
| 229 std::vector<TitleURL>(), | 230 std::vector<TitleURL>(), |
| 230 std::vector<TitleURL>(personal, personal + arraysize(personal)), | 231 std::vector<TitleURL>(personal, personal + arraysize(personal)), |
| 231 std::vector<std::string>(old, old + arraysize(old)), old_sites_source, | 232 std::vector<std::string>(old, old + arraysize(old)), old_sites_source, |
| 232 std::vector<bool>(expected_source_is_personal, | 233 std::vector<bool>(expected_source_is_personal, |
| 233 expected_source_is_personal + | 234 expected_source_is_personal + |
| 234 arraysize(expected_source_is_personal)), | 235 arraysize(expected_source_is_personal)), |
| 235 std::vector<TitleURL>(expected, expected + arraysize(expected))); | 236 std::vector<TitleURL>(expected, expected + arraysize(expected))); |
| 236 } | 237 } |
| OLD | NEW |