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

Unified Diff: extensions/common/manifest_handlers/icons_handler_unittest.cc

Issue 1908953003: Convert //extensions/{common,shell} from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? 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
Index: extensions/common/manifest_handlers/icons_handler_unittest.cc
diff --git a/extensions/common/manifest_handlers/icons_handler_unittest.cc b/extensions/common/manifest_handlers/icons_handler_unittest.cc
index fa644a940ce4f434f250cc93be4c9aa0e382f8a3..7f31f2f2be2e2f6876612e35a4bd2f6601eb8d49 100644
--- a/extensions/common/manifest_handlers/icons_handler_unittest.cc
+++ b/extensions/common/manifest_handlers/icons_handler_unittest.cc
@@ -14,18 +14,19 @@ class ProductIconManifestTest : public ManifestTest {
ProductIconManifestTest() {}
protected:
- scoped_ptr<base::DictionaryValue> CreateManifest(
+ std::unique_ptr<base::DictionaryValue> CreateManifest(
const std::string& extra_icons) {
- scoped_ptr<base::DictionaryValue> manifest = base::DictionaryValue::From(
- base::test::ParseJson("{ \n"
- " \"name\": \"test\", \n"
- " \"version\": \"0.1\", \n"
- " \"manifest_version\": 2, \n"
- " \"icons\": { \n" +
- extra_icons + " \"16\": \"icon1.png\", \n"
- " \"32\": \"icon2.png\" \n"
- " } \n"
- "} \n"));
+ std::unique_ptr<base::DictionaryValue> manifest =
+ base::DictionaryValue::From(
+ base::test::ParseJson("{ \n"
+ " \"name\": \"test\", \n"
+ " \"version\": \"0.1\", \n"
+ " \"manifest_version\": 2, \n"
+ " \"icons\": { \n" +
+ extra_icons + " \"16\": \"icon1.png\", \n"
+ " \"32\": \"icon2.png\" \n"
+ " } \n"
+ "} \n"));
EXPECT_TRUE(manifest);
return manifest;
}
@@ -37,28 +38,28 @@ class ProductIconManifestTest : public ManifestTest {
TEST_F(ProductIconManifestTest, Sizes) {
// Too big.
{
- scoped_ptr<base::DictionaryValue> ext_manifest =
+ std::unique_ptr<base::DictionaryValue> ext_manifest =
CreateManifest("\"100000\": \"icon3.png\", \n");
ManifestData manifest(std::move(ext_manifest), "test");
LoadAndExpectError(manifest, "Invalid key in icons: \"100000\".");
}
// Too small.
{
- scoped_ptr<base::DictionaryValue> ext_manifest =
+ std::unique_ptr<base::DictionaryValue> ext_manifest =
CreateManifest("\"0\": \"icon3.png\", \n");
ManifestData manifest(std::move(ext_manifest), "test");
LoadAndExpectError(manifest, "Invalid key in icons: \"0\".");
}
// NaN.
{
- scoped_ptr<base::DictionaryValue> ext_manifest =
+ std::unique_ptr<base::DictionaryValue> ext_manifest =
CreateManifest("\"sixteen\": \"icon3.png\", \n");
ManifestData manifest(std::move(ext_manifest), "test");
LoadAndExpectError(manifest, "Invalid key in icons: \"sixteen\".");
}
// Just right.
{
- scoped_ptr<base::DictionaryValue> ext_manifest =
+ std::unique_ptr<base::DictionaryValue> ext_manifest =
CreateManifest("\"512\": \"icon3.png\", \n");
ManifestData manifest(std::move(ext_manifest), "test");
scoped_refptr<extensions::Extension> extension =
« no previous file with comments | « extensions/common/manifest_handlers/icons_handler.cc ('k') | extensions/common/manifest_handlers/incognito_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698