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

Unified Diff: components/offline_pages/client_policy_controller_unittest.cc

Issue 2111653002: [Offline Pages] Adding metadatas for namespace async_loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing tests. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/client_policy_controller_unittest.cc
diff --git a/components/offline_pages/client_policy_controller_unittest.cc b/components/offline_pages/client_policy_controller_unittest.cc
index 918de56d593bb0cecacdc8e0fe55917f63604417..0654c343006ba5eb982f841f25ab02116d9b0430 100644
--- a/components/offline_pages/client_policy_controller_unittest.cc
+++ b/components/offline_pages/client_policy_controller_unittest.cc
@@ -17,12 +17,8 @@ namespace {
const char kUndefinedNamespace[] = "undefined";
bool isTemporary(const OfflinePageClientPolicy& policy) {
- // Check if policy has a expire period > 0 or a limited number
- // of pages allowed.
- return (policy.lifetime_policy.page_limit > kUnlimitedPages ||
- !policy.lifetime_policy.expiration_period.is_zero());
+ return policy.lifetime_policy.lifetime_type == LifetimeType::TEMPORARY;
}
-
} // namespace
class ClientPolicyControllerTest : public testing::Test {
@@ -63,4 +59,10 @@ TEST_F(ClientPolicyControllerTest, CheckLastNDefined) {
EXPECT_TRUE(isTemporary(policy));
}
+TEST_F(ClientPolicyControllerTest, CheckAsyncDefined) {
+ OfflinePageClientPolicy policy = controller()->GetPolicy(kAsyncNamespace);
+ EXPECT_EQ(policy.name_space, kAsyncNamespace);
+ EXPECT_FALSE(isTemporary(policy));
+}
+
} // namespace offline_pages
« no previous file with comments | « components/offline_pages/client_policy_controller.cc ('k') | components/offline_pages/offline_page_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698