Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/offline_pages/client_policy_controller.h" | |
| 6 | |
| 7 #include "base/bind.h" | |
| 8 #include "base/time/time.h" | |
| 9 #include "testing/gtest/include/gtest/gtest.h" | |
| 10 | |
| 11 using LifetimeType = offline_pages::LifetimePolicy::LifetimeType; | |
| 12 | |
| 13 namespace offline_pages { | |
| 14 | |
| 15 namespace { | |
| 16 const char* kBookmarkNamespace = "bookmark"; | |
| 17 const char* kUndefinedNamespace = "undefined"; | |
| 18 const OfflinePageClientPolicy kExpectedBookmarkPolicy = {"bookmark", | |
| 19 {LifetimeType::TEMPORARY, base::TimeDelta::FromDays(7), kUnlimitedPage}}; | |
| 20 } | |
| 21 | |
| 22 TEST(ClientPolicyControllerTest, FallbackTest) { | |
| 23 OfflinePageClientPolicy policy = | |
| 24 ClientPolicyController::GetInstance().GetPolicy(kUndefinedNamespace); | |
| 25 EXPECT_EQ(policy.name_space, kDefaultClientPolicy.name_space); | |
| 26 } | |
| 27 | |
| 28 TEST(ClientPolicyControllerTest, GetPredefinedPolicy) { | |
|
fgorski
2016/04/30 17:42:25
Add verification that a policy for last_n is prede
romax
2016/05/02 20:33:44
Done.
| |
| 29 OfflinePageClientPolicy policy = | |
| 30 ClientPolicyController::GetInstance().GetPolicy(kBookmarkNamespace); | |
| 31 EXPECT_EQ(policy.name_space, "bookmark"); | |
| 32 } | |
| 33 | |
| 34 } // namespace offline_pages | |
| 35 | |
| OLD | NEW |