| 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 "chrome/browser/android/preferences/important_sites_util.h" | 5 #include "chrome/browser/android/preferences/important_sites_util.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 12 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 13 #include "chrome/browser/engagement/site_engagement_helper.h" | 13 #include "chrome/browser/engagement/site_engagement_helper.h" |
| 14 #include "chrome/browser/engagement/site_engagement_metrics.h" | 14 #include "chrome/browser/engagement/site_engagement_metrics.h" |
| 15 #include "chrome/browser/engagement/site_engagement_score.h" |
| 15 #include "chrome/browser/engagement/site_engagement_service.h" | 16 #include "chrome/browser/engagement/site_engagement_service.h" |
| 16 #include "chrome/browser/engagement/site_engagement_service_factory.h" | 17 #include "chrome/browser/engagement/site_engagement_service_factory.h" |
| 17 #include "chrome/browser/history/history_service_factory.h" | 18 #include "chrome/browser/history/history_service_factory.h" |
| 18 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 19 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
| 20 #include "components/content_settings/core/browser/host_content_settings_map.h" | 21 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 21 #include "components/content_settings/core/common/content_settings.h" | 22 #include "components/content_settings/core/common/content_settings.h" |
| 22 #include "components/content_settings/core/common/content_settings_pattern.h" | 23 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 23 #include "components/history/core/browser/history_database_params.h" | 24 #include "components/history/core/browser/history_database_params.h" |
| 24 #include "components/history/core/browser/history_service.h" | 25 #include "components/history/core/browser/history_service.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 AddContentSetting(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTING_BLOCK, | 117 AddContentSetting(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTING_BLOCK, |
| 117 url1); | 118 url1); |
| 118 | 119 |
| 119 // Same as above, but the site with notifications should be at the front. | 120 // Same as above, but the site with notifications should be at the front. |
| 120 expected_sorted_domains = {"youtube.com", "foo.bar", "example.com", | 121 expected_sorted_domains = {"youtube.com", "foo.bar", "example.com", |
| 121 "chrome.com", "google.com"}; | 122 "chrome.com", "google.com"}; |
| 122 EXPECT_THAT(ImportantSitesUtil::GetImportantRegisterableDomains( | 123 EXPECT_THAT(ImportantSitesUtil::GetImportantRegisterableDomains( |
| 123 profile(), kNumImportantSites), | 124 profile(), kNumImportantSites), |
| 124 ::testing::ElementsAreArray(expected_sorted_domains)); | 125 ::testing::ElementsAreArray(expected_sorted_domains)); |
| 125 } | 126 } |
| OLD | NEW |