OLD | NEW |
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 "base/pickle.h" | 5 #include "base/pickle.h" |
6 #include "base/values.h" | 6 #include "base/values.h" |
7 #include "extensions/common/permissions/manifest_permission.h" | 7 #include "extensions/common/permissions/manifest_permission.h" |
8 #include "extensions/common/permissions/manifest_permission_set.h" | 8 #include "extensions/common/permissions/manifest_permission_set.h" |
9 #include "ipc/ipc_message.h" | 9 #include "ipc/ipc_message.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 virtual scoped_ptr<base::Value> ToValue() const OVERRIDE { | 38 virtual scoped_ptr<base::Value> ToValue() const OVERRIDE { |
39 return make_scoped_ptr(base::Value::CreateNullValue()); | 39 return make_scoped_ptr(base::Value::CreateNullValue()); |
40 } | 40 } |
41 | 41 |
42 virtual ManifestPermission* Diff(const ManifestPermission* rhs) | 42 virtual ManifestPermission* Diff(const ManifestPermission* rhs) |
43 const OVERRIDE { | 43 const OVERRIDE { |
44 const MockManifestPermission* other = | 44 const MockManifestPermission* other = |
45 static_cast<const MockManifestPermission*>(rhs); | 45 static_cast<const MockManifestPermission*>(rhs); |
46 EXPECT_EQ(name_, other->name_); | 46 EXPECT_EQ(name_, other->name_); |
47 return NULL; | 47 return nullptr; |
48 } | 48 } |
49 | 49 |
50 virtual ManifestPermission* Union(const ManifestPermission* rhs) | 50 virtual ManifestPermission* Union(const ManifestPermission* rhs) |
51 const OVERRIDE { | 51 const OVERRIDE { |
52 const MockManifestPermission* other = | 52 const MockManifestPermission* other = |
53 static_cast<const MockManifestPermission*>(rhs); | 53 static_cast<const MockManifestPermission*>(rhs); |
54 EXPECT_EQ(name_, other->name_); | 54 EXPECT_EQ(name_, other->name_); |
55 return new MockManifestPermission(name_); | 55 return new MockManifestPermission(name_); |
56 } | 56 } |
57 | 57 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 EXPECT_EQ(expected_permissions, result); | 226 EXPECT_EQ(expected_permissions, result); |
227 | 227 |
228 // |result| = |permissions1| - |permissions2| --> | 228 // |result| = |permissions1| - |permissions2| --> |
229 // |result| intersect |permissions2| == empty_set | 229 // |result| intersect |permissions2| == empty_set |
230 ManifestPermissionSet result2; | 230 ManifestPermissionSet result2; |
231 ManifestPermissionSet::Intersection(result, permissions2, &result2); | 231 ManifestPermissionSet::Intersection(result, permissions2, &result2); |
232 EXPECT_TRUE(result2.empty()); | 232 EXPECT_TRUE(result2.empty()); |
233 } | 233 } |
234 | 234 |
235 } // namespace extensions | 235 } // namespace extensions |
OLD | NEW |