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 "base/time/time.h" | 5 #include "base/time/time.h" |
6 #include "components/offline_pages/client_namespace_constants.h" | 6 #include "components/offline_pages/client_namespace_constants.h" |
7 #include "components/offline_pages/client_policy_controller.h" | 7 #include "components/offline_pages/client_policy_controller.h" |
| 8 #include "components/offline_pages/core/offline_page_model_query.h" |
8 #include "components/offline_pages/offline_page_client_policy.h" | 9 #include "components/offline_pages/offline_page_client_policy.h" |
9 #include "components/offline_pages/offline_page_item.h" | 10 #include "components/offline_pages/offline_page_item.h" |
10 #include "components/offline_pages/offline_page_model_query.h" | |
11 | 11 |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace offline_pages { | 14 namespace offline_pages { |
15 | 15 |
16 using Requirement = OfflinePageModelQueryBuilder::Requirement; | 16 using Requirement = OfflinePageModelQueryBuilder::Requirement; |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 const ClientId kClientId1 = {kDefaultNamespace, "id1"}; | 20 const ClientId kClientId1 = {kDefaultNamespace, "id1"}; |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 auto restriction = query->GetRestrictedToNamespaces(); | 390 auto restriction = query->GetRestrictedToNamespaces(); |
391 std::set<std::string> namespaces_allowed = restriction.second; | 391 std::set<std::string> namespaces_allowed = restriction.second; |
392 bool restricted_to_namespaces = restriction.first; | 392 bool restricted_to_namespaces = restriction.first; |
393 EXPECT_TRUE(restricted_to_namespaces); | 393 EXPECT_TRUE(restricted_to_namespaces); |
394 | 394 |
395 EXPECT_TRUE(namespaces_allowed.count(kTestNamespace) == 1); | 395 EXPECT_TRUE(namespaces_allowed.count(kTestNamespace) == 1); |
396 EXPECT_FALSE(query->Matches(recent_page())); | 396 EXPECT_FALSE(query->Matches(recent_page())); |
397 } | 397 } |
398 | 398 |
399 } // namespace offline_pages | 399 } // namespace offline_pages |
OLD | NEW |