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

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_storage_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 "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" 5 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
6 6
7 #include "extensions/common/manifest_constants.h" 7 #include "extensions/common/manifest_constants.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace keys = extensions::manifest_keys; 10 namespace keys = extensions::manifest_keys;
11 11
12 TEST_F(ChromeManifestTest, StorageAPIManifestVersionAvailability) { 12 TEST_F(ChromeManifestTest, StorageAPIManifestVersionAvailability) {
13 base::DictionaryValue base_manifest; 13 base::DictionaryValue base_manifest;
14 { 14 {
15 base_manifest.SetString(keys::kName, "test"); 15 base_manifest.SetString(keys::kName, "test");
16 base_manifest.SetString(keys::kVersion, "0.1"); 16 base_manifest.SetString(keys::kVersion, "0.1");
17 base::ListValue* permissions = new base::ListValue(); 17 base::ListValue* permissions = new base::ListValue();
18 permissions->Append(new base::StringValue("storage")); 18 permissions->AppendString("storage");
19 base_manifest.Set(keys::kPermissions, permissions); 19 base_manifest.Set(keys::kPermissions, permissions);
20 } 20 }
21 21
22 std::string kManifestVersionError = 22 std::string kManifestVersionError =
23 "'storage' requires manifest version of at least 2."; 23 "'storage' requires manifest version of at least 2.";
24 24
25 // Extension with no manifest version cannot use storage API. 25 // Extension with no manifest version cannot use storage API.
26 { 26 {
27 ManifestData manifest(&base_manifest, "test"); 27 ManifestData manifest(&base_manifest, "test");
28 LoadAndExpectWarning(manifest, kManifestVersionError); 28 LoadAndExpectWarning(manifest, kManifestVersionError);
(...skipping 14 matching lines...) Expand all
43 base::DictionaryValue manifest_with_version; 43 base::DictionaryValue manifest_with_version;
44 manifest_with_version.SetInteger(keys::kManifestVersion, 2); 44 manifest_with_version.SetInteger(keys::kManifestVersion, 2);
45 manifest_with_version.MergeDictionary(&base_manifest); 45 manifest_with_version.MergeDictionary(&base_manifest);
46 46
47 ManifestData manifest(&manifest_with_version, "test"); 47 ManifestData manifest(&manifest_with_version, "test");
48 scoped_refptr<extensions::Extension> extension = 48 scoped_refptr<extensions::Extension> extension =
49 LoadAndExpectSuccess(manifest); 49 LoadAndExpectSuccess(manifest);
50 EXPECT_TRUE(extension->install_warnings().empty()); 50 EXPECT_TRUE(extension->install_warnings().empty());
51 } 51 }
52 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698