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

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

Issue 1928393003: Using separate directories based on LifetimeType. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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) {
29 OfflinePageClientPolicy policy =
30 ClientPolicyController::GetInstance().GetPolicy(kBookmarkNamespace);
31 EXPECT_EQ(policy.name_space, "bookmark");
32 }
33
34 } // namespace offline_pages
35
OLDNEW
« no previous file with comments | « components/offline_pages/client_policy_controller.cc ('k') | components/offline_pages/offline_page_client_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698