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

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_validapp_unittest.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" 9 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
10 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" 10 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
(...skipping 13 matching lines...) Expand all
24 EXPECT_EQ(GURL("http://www.google.com/mail/"), 24 EXPECT_EQ(GURL("http://www.google.com/mail/"),
25 extensions::AppLaunchInfo::GetLaunchWebURL(extension.get())); 25 extensions::AppLaunchInfo::GetLaunchWebURL(extension.get()));
26 } 26 }
27 27
28 TEST_F(ValidAppManifestTest, AllowUnrecognizedPermissions) { 28 TEST_F(ValidAppManifestTest, AllowUnrecognizedPermissions) {
29 std::string error; 29 std::string error;
30 std::unique_ptr<base::DictionaryValue> manifest( 30 std::unique_ptr<base::DictionaryValue> manifest(
31 LoadManifest("valid_app.json", &error)); 31 LoadManifest("valid_app.json", &error));
32 base::ListValue* permissions = NULL; 32 base::ListValue* permissions = NULL;
33 ASSERT_TRUE(manifest->GetList("permissions", &permissions)); 33 ASSERT_TRUE(manifest->GetList("permissions", &permissions));
34 permissions->Append(new base::StringValue("not-a-valid-permission")); 34 permissions->AppendString("not-a-valid-permission");
35 LoadAndExpectSuccess(ManifestData(std::move(manifest), "")); 35 LoadAndExpectSuccess(ManifestData(std::move(manifest), ""));
36 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698