summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/chrome_tests_unit.gypi5
-rw-r--r--chrome/common/extensions/permissions/permissions_data_unittest.cc (renamed from extensions/common/permissions/permissions_data_unittest.cc)23
-rw-r--r--extensions/DEPS6
-rw-r--r--extensions/common/permissions/socket_permission_unittest.cc (renamed from chrome/common/extensions/permissions/socket_permission_unittest.cc)11
-rw-r--r--extensions/common/permissions/usb_device_permission_unittest.cc (renamed from chrome/common/extensions/permissions/usb_device_permission_unittest.cc)0
-rw-r--r--extensions/extensions.gyp2
6 files changed, 19 insertions, 28 deletions
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 04f112a1cf7..2e8b672 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -541,7 +541,6 @@
'../extensions/common/manifest_handlers/externally_connectable_unittest.cc',
'../extensions/common/manifest_handlers/file_handler_manifest_unittest.cc',
'../extensions/common/manifest_handlers/shared_module_manifest_unittest.cc',
- '../extensions/common/permissions/permissions_data_unittest.cc',
# histograms.xml is analyzed by AboutFlagsHistogramTest, so this
# dependency is needed to make commit bots run unit_tests on
# histograms.xml changes.
@@ -1836,9 +1835,8 @@
'common/extensions/manifest_unittest.cc',
'common/extensions/permissions/media_galleries_permission_unittest.cc',
'common/extensions/permissions/permission_set_unittest.cc',
+ 'common/extensions/permissions/permissions_data_unittest.cc',
'common/extensions/permissions/settings_override_permission_unittest.cc',
- 'common/extensions/permissions/socket_permission_unittest.cc',
- 'common/extensions/permissions/usb_device_permission_unittest.cc',
'common/extensions/sync_type_unittest.cc',
'common/extensions/update_manifest_unittest.cc',
'common/extensions/value_counter_unittest.cc',
@@ -2097,6 +2095,7 @@
'browser/web_applications/web_app_unittest.cc',
'common/extensions/sync_type_unittest.cc',
'common/extensions/permissions/permission_set_unittest.cc',
+ 'common/extensions/permissions/permissions_data_unittest.cc',
'renderer/extensions/extension_localization_peer_unittest.cc',
'renderer/extensions/renderer_permissions_policy_delegate_unittest.cc',
],
diff --git a/extensions/common/permissions/permissions_data_unittest.cc b/chrome/common/extensions/permissions/permissions_data_unittest.cc
index 7374d34..b34260e 100644
--- a/extensions/common/permissions/permissions_data_unittest.cc
+++ b/chrome/common/extensions/permissions/permissions_data_unittest.cc
@@ -8,9 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/extension_test_util.h"
-#include "chrome/common/extensions/features/feature_channel.h"
#include "components/crx_file/id_util.h"
#include "content/public/common/socket_permission_request.h"
#include "extensions/common/error_utils.h"
@@ -141,7 +139,10 @@ void CheckRestrictedUrls(const Extension* extension,
} // namespace
-TEST(ExtensionPermissionsTest, EffectiveHostPermissions) {
+// NOTE: These tests run in Chrome's unit_tests suite because they depend on
+// extension manifest keys (like "content_scripts") that do not exist yet in the
+// src/extensions module.
+TEST(PermissionsDataTest, EffectiveHostPermissions) {
scoped_refptr<Extension> extension;
URLPatternSet hosts;
@@ -216,9 +217,7 @@ TEST(ExtensionPermissionsTest, EffectiveHostPermissions) {
EXPECT_TRUE(extension->permissions_data()->HasEffectiveAccessToAllHosts());
}
-TEST(ExtensionPermissionsTest, SocketPermissions) {
- // Set feature current channel to appropriate value.
- ScopedCurrentChannel scoped_channel(chrome::VersionInfo::CHANNEL_DEV);
+TEST(PermissionsDataTest, SocketPermissions) {
scoped_refptr<Extension> extension;
std::string error;
@@ -253,7 +252,7 @@ TEST(ExtensionPermissionsTest, SocketPermissions) {
"239.255.255.250", 1900));
}
-TEST(ExtensionPermissionsTest, IsRestrictedUrl) {
+TEST(PermissionsDataTest, IsRestrictedUrl) {
scoped_refptr<const Extension> extension =
GetExtensionWithHostPermission("normal_extension",
kAllHostsPermission,
@@ -274,7 +273,7 @@ TEST(ExtensionPermissionsTest, IsRestrictedUrl) {
CheckRestrictedUrls(extension.get(), false);
}
-TEST(ExtensionPermissionsTest, GetPermissionMessages_ManyAPIPermissions) {
+TEST(PermissionsDataTest, GetPermissionMessages_ManyAPIPermissions) {
scoped_refptr<Extension> extension;
extension = LoadManifest("permissions", "many-apis.json");
std::vector<base::string16> warnings =
@@ -290,7 +289,7 @@ TEST(ExtensionPermissionsTest, GetPermissionMessages_ManyAPIPermissions) {
UTF16ToUTF8(warnings[4]));
}
-TEST(ExtensionPermissionsTest, GetPermissionMessages_ManyHostsPermissions) {
+TEST(PermissionsDataTest, GetPermissionMessages_ManyHostsPermissions) {
scoped_refptr<Extension> extension;
extension = LoadManifest("permissions", "more-than-3-hosts.json");
std::vector<base::string16> warnings =
@@ -305,7 +304,7 @@ TEST(ExtensionPermissionsTest, GetPermissionMessages_ManyHostsPermissions) {
UTF16ToUTF8(warnings_details[0]));
}
-TEST(ExtensionPermissionsTest, GetPermissionMessages_LocationApiPermission) {
+TEST(PermissionsDataTest, GetPermissionMessages_LocationApiPermission) {
scoped_refptr<Extension> extension;
extension = LoadManifest("permissions",
"location-api.json",
@@ -317,7 +316,7 @@ TEST(ExtensionPermissionsTest, GetPermissionMessages_LocationApiPermission) {
EXPECT_EQ("Detect your physical location", UTF16ToUTF8(warnings[0]));
}
-TEST(ExtensionPermissionsTest, GetPermissionMessages_ManyHosts) {
+TEST(PermissionsDataTest, GetPermissionMessages_ManyHosts) {
scoped_refptr<Extension> extension;
extension = LoadManifest("permissions", "many-hosts.json");
std::vector<base::string16> warnings =
@@ -328,7 +327,7 @@ TEST(ExtensionPermissionsTest, GetPermissionMessages_ManyHosts) {
UTF16ToUTF8(warnings[0]));
}
-TEST(ExtensionPermissionsTest, GetPermissionMessages_Plugins) {
+TEST(PermissionsDataTest, GetPermissionMessages_Plugins) {
scoped_refptr<Extension> extension;
extension = LoadManifest("permissions", "plugins.json");
std::vector<base::string16> warnings =
diff --git a/extensions/DEPS b/extensions/DEPS
index e6b483f..836d930 100644
--- a/extensions/DEPS
+++ b/extensions/DEPS
@@ -40,16 +40,10 @@ specific_include_rules = {
"+chrome/common/chrome_paths.h",
"+chrome/common/extensions/features/feature_channel.h",
"+chrome/common/extensions/manifest_tests/extension_manifest_test.h",
- "+chrome/test/base/browser_with_test_window_test.h",
"+chrome/test/base/testing_profile.h",
"+chrome/test/base/ui_test_utils.h",
],
"(simple|complex)_feature_unittest\.cc|base_feature_provider_unittest\.cc": [
"+chrome/common/extensions/features/chrome_channel_feature_filter.h",
],
- "permissions_data_unittest\.cc": [
- "+chrome/common/chrome_version_info.h",
- "+chrome/common/extensions/extension_test_util.h",
- "+chrome/common/extensions/features/feature_channel.h",
- ],
}
diff --git a/chrome/common/extensions/permissions/socket_permission_unittest.cc b/extensions/common/permissions/socket_permission_unittest.cc
index bcbeb97..0b1fae0 100644
--- a/chrome/common/extensions/permissions/socket_permission_unittest.cc
+++ b/extensions/common/permissions/socket_permission_unittest.cc
@@ -264,7 +264,7 @@ TEST(SocketPermissionTest, Match) {
TEST(SocketPermissionTest, IPC) {
const APIPermissionInfo* permission_info =
- PermissionsInfo::GetInstance()->GetByID(APIPermission::kSocket);
+ PermissionsInfo::GetInstance()->GetByID(APIPermission::kSocket);
{
IPC::Message m;
@@ -306,12 +306,10 @@ TEST(SocketPermissionTest, IPC) {
TEST(SocketPermissionTest, Value) {
const APIPermissionInfo* permission_info =
- PermissionsInfo::GetInstance()->GetByID(APIPermission::kSocket);
+ PermissionsInfo::GetInstance()->GetByID(APIPermission::kSocket);
- scoped_ptr<APIPermission> permission1(
- permission_info->CreateAPIPermission());
- scoped_ptr<APIPermission> permission2(
- permission_info->CreateAPIPermission());
+ scoped_ptr<APIPermission> permission1(permission_info->CreateAPIPermission());
+ scoped_ptr<APIPermission> permission2(permission_info->CreateAPIPermission());
scoped_ptr<base::ListValue> value(new base::ListValue());
value->AppendString("tcp-connect:*.example.com:80");
@@ -330,4 +328,3 @@ TEST(SocketPermissionTest, Value) {
} // namespace
} // namespace extensions
-
diff --git a/chrome/common/extensions/permissions/usb_device_permission_unittest.cc b/extensions/common/permissions/usb_device_permission_unittest.cc
index ee92932..ee92932 100644
--- a/chrome/common/extensions/permissions/usb_device_permission_unittest.cc
+++ b/extensions/common/permissions/usb_device_permission_unittest.cc
diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp
index 99e4843..bee4c12 100644
--- a/extensions/extensions.gyp
+++ b/extensions/extensions.gyp
@@ -1103,6 +1103,8 @@
'common/one_shot_event_unittest.cc',
'common/permissions/api_permission_set_unittest.cc',
'common/permissions/manifest_permission_set_unittest.cc',
+ 'common/permissions/socket_permission_unittest.cc',
+ 'common/permissions/usb_device_permission_unittest.cc',
'common/url_pattern_set_unittest.cc',
'common/url_pattern_unittest.cc',
'common/user_script_unittest.cc',