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

Unified Diff: services/catalog/entry_unittest.cc

Issue 1910673002: Convert //services from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « services/catalog/entry.cc ('k') | services/catalog/instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/catalog/entry_unittest.cc
diff --git a/services/catalog/entry_unittest.cc b/services/catalog/entry_unittest.cc
index c1dcc3300047fc579a50aadaf59aab97709d082d..3b4ffbc690e757a482dc282aa1aedbb0e93896d9 100644
--- a/services/catalog/entry_unittest.cc
+++ b/services/catalog/entry_unittest.cc
@@ -21,9 +21,9 @@ class EntryTest : public testing::Test {
~EntryTest() override {}
protected:
- scoped_ptr<Entry> ReadEntry(const std::string& manifest,
- scoped_ptr<base::Value>* out_value) {
- scoped_ptr<base::Value> value = ReadManifest(manifest);
+ std::unique_ptr<Entry> ReadEntry(const std::string& manifest,
+ std::unique_ptr<base::Value>* out_value) {
+ std::unique_ptr<base::Value> value = ReadManifest(manifest);
base::DictionaryValue* dictionary = nullptr;
CHECK(value->GetAsDictionary(&dictionary));
if (out_value)
@@ -31,7 +31,7 @@ class EntryTest : public testing::Test {
return Entry::Deserialize(*dictionary);
}
- scoped_ptr<base::Value> ReadManifest(const std::string& manifest) {
+ std::unique_ptr<base::Value> ReadManifest(const std::string& manifest) {
base::FilePath manifest_path;
PathService::Get(base::DIR_SOURCE_ROOT, &manifest_path);
manifest_path = manifest_path.AppendASCII(
@@ -54,21 +54,21 @@ class EntryTest : public testing::Test {
};
TEST_F(EntryTest, Simple) {
- scoped_ptr<Entry> entry = ReadEntry("simple", nullptr);
+ std::unique_ptr<Entry> entry = ReadEntry("simple", nullptr);
EXPECT_EQ("mojo:foo", entry->name());
EXPECT_EQ(shell::GetNamePath(entry->name()), entry->qualifier());
EXPECT_EQ("Foo", entry->display_name());
}
TEST_F(EntryTest, Instance) {
- scoped_ptr<Entry> entry = ReadEntry("instance", nullptr);
+ std::unique_ptr<Entry> entry = ReadEntry("instance", nullptr);
EXPECT_EQ("mojo:foo", entry->name());
EXPECT_EQ("bar", entry->qualifier());
EXPECT_EQ("Foo", entry->display_name());
}
TEST_F(EntryTest, Capabilities) {
- scoped_ptr<Entry> entry = ReadEntry("capabilities", nullptr);
+ std::unique_ptr<Entry> entry = ReadEntry("capabilities", nullptr);
EXPECT_EQ("mojo:foo", entry->name());
EXPECT_EQ("bar", entry->qualifier());
@@ -81,20 +81,20 @@ TEST_F(EntryTest, Capabilities) {
}
TEST_F(EntryTest, Serialization) {
- scoped_ptr<base::Value> value;
- scoped_ptr<Entry> entry = ReadEntry("serialization", &value);
+ std::unique_ptr<base::Value> value;
+ std::unique_ptr<Entry> entry = ReadEntry("serialization", &value);
- scoped_ptr<base::DictionaryValue> serialized(entry->Serialize());
+ std::unique_ptr<base::DictionaryValue> serialized(entry->Serialize());
// We can't just compare values, since during deserialization some of the
// lists get converted to std::sets, which are sorted, so Value::Equals will
// fail.
- scoped_ptr<Entry> reconstituted = Entry::Deserialize(*serialized.get());
+ std::unique_ptr<Entry> reconstituted = Entry::Deserialize(*serialized.get());
EXPECT_EQ(*entry, *reconstituted);
}
TEST_F(EntryTest, Malformed) {
- scoped_ptr<base::Value> value = ReadManifest("malformed");
+ std::unique_ptr<base::Value> value = ReadManifest("malformed");
EXPECT_FALSE(value.get());
}
« no previous file with comments | « services/catalog/entry.cc ('k') | services/catalog/instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698