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

Unified Diff: chrome/browser/policy/policy_domain_descriptor_unittest.cc

Issue 47513018: Make the internal storage of policy::Schemas ref counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-4-new-generate
Patch Set: rebase Created 7 years, 1 month 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: chrome/browser/policy/policy_domain_descriptor_unittest.cc
diff --git a/chrome/browser/policy/policy_domain_descriptor_unittest.cc b/chrome/browser/policy/policy_domain_descriptor_unittest.cc
index 4ef89fc9ae3477db9a7fc39030e32c2694e93ed6..7841a8a6c687814fac2b3da15346decc6495c381 100644
--- a/chrome/browser/policy/policy_domain_descriptor_unittest.cc
+++ b/chrome/browser/policy/policy_domain_descriptor_unittest.cc
@@ -36,7 +36,7 @@ TEST_F(PolicyDomainDescriptorTest, FilterBundle) {
EXPECT_TRUE(descriptor->components().empty());
std::string error;
- scoped_ptr<SchemaOwner> schema = SchemaOwner::Parse(
+ Schema schema = Schema::Parse(
"{"
" \"type\":\"object\","
" \"properties\": {"
@@ -58,9 +58,9 @@ TEST_F(PolicyDomainDescriptorTest, FilterBundle) {
" \"String\": { \"type\": \"string\" }"
" }"
"}", &error);
- ASSERT_TRUE(schema) << error;
+ ASSERT_TRUE(schema.valid()) << error;
- descriptor->RegisterComponent("abc", schema.Pass());
+ descriptor->RegisterComponent("abc", schema);
EXPECT_EQ(1u, descriptor->components().size());
EXPECT_EQ(1u, descriptor->components().count("abc"));
@@ -152,17 +152,17 @@ TEST_F(PolicyDomainDescriptorTest, LegacyComponents) {
EXPECT_TRUE(descriptor->components().empty());
std::string error;
- scoped_ptr<SchemaOwner> schema = SchemaOwner::Parse(
+ Schema schema = Schema::Parse(
"{"
" \"type\":\"object\","
" \"properties\": {"
" \"String\": { \"type\": \"string\" }"
" }"
"}", &error);
- ASSERT_TRUE(schema) << error;
+ ASSERT_TRUE(schema.valid()) << error;
- descriptor->RegisterComponent("with-schema", schema.Pass());
- descriptor->RegisterComponent("without-schema", scoped_ptr<SchemaOwner>());
+ descriptor->RegisterComponent("with-schema", schema);
+ descriptor->RegisterComponent("without-schema", Schema());
EXPECT_EQ(2u, descriptor->components().size());
« no previous file with comments | « chrome/browser/policy/policy_domain_descriptor.cc ('k') | chrome/browser/policy/policy_service_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698