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

Side by Side Diff: extensions/common/permissions/manifest_permission_set_unittest.cc

Issue 2792573002: Remove base::Value::CreateNullValue (Closed)
Patch Set: Rebase Created 3 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/app_window/app_window.cc ('k') | extensions/renderer/api_signature.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/common/permissions/manifest_permission_set.h"
6
7 #include "base/memory/ptr_util.h"
5 #include "base/pickle.h" 8 #include "base/pickle.h"
6 #include "base/values.h" 9 #include "base/values.h"
7 #include "extensions/common/permissions/manifest_permission.h" 10 #include "extensions/common/permissions/manifest_permission.h"
8 #include "extensions/common/permissions/manifest_permission_set.h"
9 #include "ipc/ipc_message.h" 11 #include "ipc/ipc_message.h"
10 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
11 13
12 namespace extensions { 14 namespace extensions {
13 15
14 class MockManifestPermission : public ManifestPermission { 16 class MockManifestPermission : public ManifestPermission {
15 public: 17 public:
16 MockManifestPermission(const std::string& name) 18 MockManifestPermission(const std::string& name)
17 : name_(name) { 19 : name_(name) {
18 } 20 }
19 21
20 std::string name() const override { return name_; } 22 std::string name() const override { return name_; }
21 23
22 std::string id() const override { return name(); } 24 std::string id() const override { return name(); }
23 25
24 PermissionIDSet GetPermissions() const override { return PermissionIDSet(); } 26 PermissionIDSet GetPermissions() const override { return PermissionIDSet(); }
25 27
26 bool FromValue(const base::Value* value) override { return true; } 28 bool FromValue(const base::Value* value) override { return true; }
27 29
28 std::unique_ptr<base::Value> ToValue() const override { 30 std::unique_ptr<base::Value> ToValue() const override {
29 return base::Value::CreateNullValue(); 31 return base::MakeUnique<base::Value>();
30 } 32 }
31 33
32 ManifestPermission* Diff(const ManifestPermission* rhs) const override { 34 ManifestPermission* Diff(const ManifestPermission* rhs) const override {
33 const MockManifestPermission* other = 35 const MockManifestPermission* other =
34 static_cast<const MockManifestPermission*>(rhs); 36 static_cast<const MockManifestPermission*>(rhs);
35 EXPECT_EQ(name_, other->name_); 37 EXPECT_EQ(name_, other->name_);
36 return NULL; 38 return NULL;
37 } 39 }
38 40
39 ManifestPermission* Union(const ManifestPermission* rhs) const override { 41 ManifestPermission* Union(const ManifestPermission* rhs) const override {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 EXPECT_EQ(expected_permissions, result); 215 EXPECT_EQ(expected_permissions, result);
214 216
215 // |result| = |permissions1| - |permissions2| --> 217 // |result| = |permissions1| - |permissions2| -->
216 // |result| intersect |permissions2| == empty_set 218 // |result| intersect |permissions2| == empty_set
217 ManifestPermissionSet result2; 219 ManifestPermissionSet result2;
218 ManifestPermissionSet::Intersection(result, permissions2, &result2); 220 ManifestPermissionSet::Intersection(result, permissions2, &result2);
219 EXPECT_TRUE(result2.empty()); 221 EXPECT_TRUE(result2.empty());
220 } 222 }
221 223
222 } // namespace extensions 224 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/app_window/app_window.cc ('k') | extensions/renderer/api_signature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698