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

Unified Diff: components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc

Issue 2706293005: Fix DCHECK hit on component policy fetch with empty ID (Closed)
Patch Set: Created 3 years, 10 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/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
diff --git a/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
index 9798ea0b7d00e16e4aa396a19bc04bcd24a01191..21ecc437b82959ff877afce578241ce0518b76f6 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
@@ -241,6 +241,13 @@ TEST_F(ComponentCloudPolicyStoreTest, ValidatePolicyBadSignature) {
nullptr /* payload */));
}
+TEST_F(ComponentCloudPolicyStoreTest, ValidatePolicyEmptyComponentId) {
+ builder_.policy_data().set_settings_entity_id(std::string());
+ EXPECT_FALSE(store_->ValidatePolicy(
+ PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, std::string()),
+ CreateResponse(), nullptr /* policy_data */, nullptr /* payload */));
+}
+
TEST_F(ComponentCloudPolicyStoreTest, ValidatePolicyWrongPublicKey) {
// Test against a policy signed with a wrong key.
builder_.SetSigningKey(*ComponentPolicyBuilder::CreateTestOtherSigningKey());

Powered by Google App Engine
This is Rietveld 408576698