| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/permissions/chrome_permission_message_provide
r.h" | 5 #include "chrome/common/extensions/permissions/chrome_permission_message_provide
r.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
| 14 #include "extensions/common/permissions/permission_set.h" | 14 #include "extensions/common/permissions/permission_set.h" |
| 15 #include "extensions/common/permissions/permissions_info.h" | 15 #include "extensions/common/permissions/permissions_info.h" |
| 16 #include "extensions/common/permissions/settings_override_permission.h" | 16 #include "extensions/common/permissions/settings_override_permission.h" |
| 17 #include "extensions/common/permissions/usb_device_permission.h" | 17 #include "extensions/common/permissions/usb_device_permission.h" |
| 18 #include "extensions/common/url_pattern_set.h" | 18 #include "extensions/common/url_pattern_set.h" |
| 19 #include "extensions/strings/grit/extensions_strings.h" | |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 22 | 21 |
| 23 namespace extensions { | 22 namespace extensions { |
| 24 | 23 |
| 25 // Tests that ChromePermissionMessageProvider provides correct permission | 24 // Tests that ChromePermissionMessageProvider provides correct permission |
| 26 // messages for given permissions. | 25 // messages for given permissions. |
| 27 // NOTE: No extensions are created as part of these tests. Integration tests | 26 // NOTE: No extensions are created as part of these tests. Integration tests |
| 28 // that test the messages are generated properly for extensions can be found in | 27 // that test the messages are generated properly for extensions can be found in |
| 29 // chrome/browser/extensions/permission_messages_unittest.cc. | 28 // chrome/browser/extensions/permission_messages_unittest.cc. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 148 |
| 150 EXPECT_FALSE(IsPrivilegeIncrease(granted_permissions, actual_permissions)); | 149 EXPECT_FALSE(IsPrivilegeIncrease(granted_permissions, actual_permissions)); |
| 151 | 150 |
| 152 // Just to be safe: Adding the permission (with or without parameter) should | 151 // Just to be safe: Adding the permission (with or without parameter) should |
| 153 // still be considered a privilege escalation. | 152 // still be considered a privilege escalation. |
| 154 EXPECT_TRUE(IsPrivilegeIncrease(APIPermissionSet(), granted_permissions)); | 153 EXPECT_TRUE(IsPrivilegeIncrease(APIPermissionSet(), granted_permissions)); |
| 155 EXPECT_TRUE(IsPrivilegeIncrease(APIPermissionSet(), actual_permissions)); | 154 EXPECT_TRUE(IsPrivilegeIncrease(APIPermissionSet(), actual_permissions)); |
| 156 } | 155 } |
| 157 | 156 |
| 158 } // namespace extensions | 157 } // namespace extensions |
| OLD | NEW |