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

Side by Side Diff: components/offline_pages/client_policy_controller_unittest.cc

Issue 1934743003: Implementing client policy and controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing build errors. Created 4 years, 7 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698