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

Unified Diff: chrome/common/extensions/permissions/permission_set_unittest.cc

Issue 388963002: Get rid of the rest of CreateStringValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad rebase Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/permissions/permission_set_unittest.cc
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index b56a98e7a235349ced6791866cbd5b045e2086d9..d1c1b7fa2808a3065d137f9893d26ce1943b0f59 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -258,10 +258,9 @@ TEST(PermissionsTest, CreateUnion) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(
- base::Value::CreateStringValue("tcp-connect:*.example.com:80"));
- value->Append(base::Value::CreateStringValue("udp-bind::8080"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8888"));
+ value->Append(new base::StringValue("tcp-connect:*.example.com:80"));
+ value->Append(new base::StringValue("udp-bind::8080"));
+ value->Append(new base::StringValue("udp-send-to::8888"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
@@ -304,9 +303,8 @@ TEST(PermissionsTest, CreateUnion) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(
- base::Value::CreateStringValue("tcp-connect:*.example.com:80"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8899"));
+ value->Append(new base::StringValue("tcp-connect:*.example.com:80"));
+ value->Append(new base::StringValue("udp-send-to::8899"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
apis2.insert(permission);
@@ -319,11 +317,10 @@ TEST(PermissionsTest, CreateUnion) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(
- base::Value::CreateStringValue("tcp-connect:*.example.com:80"));
- value->Append(base::Value::CreateStringValue("udp-bind::8080"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8888"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8899"));
+ value->Append(new base::StringValue("tcp-connect:*.example.com:80"));
+ value->Append(new base::StringValue("udp-bind::8080"));
+ value->Append(new base::StringValue("udp-send-to::8888"));
+ value->Append(new base::StringValue("udp-send-to::8899"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
// Insert a new permission socket permisssion which will replace the old one.
@@ -387,10 +384,9 @@ TEST(PermissionsTest, CreateIntersection) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(
- base::Value::CreateStringValue("tcp-connect:*.example.com:80"));
- value->Append(base::Value::CreateStringValue("udp-bind::8080"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8888"));
+ value->Append(new base::StringValue("tcp-connect:*.example.com:80"));
+ value->Append(new base::StringValue("udp-bind::8080"));
+ value->Append(new base::StringValue("udp-send-to::8888"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
apis1.insert(permission);
@@ -425,9 +421,9 @@ TEST(PermissionsTest, CreateIntersection) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(base::Value::CreateStringValue("udp-bind::8080"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8888"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8899"));
+ value->Append(new base::StringValue("udp-bind::8080"));
+ value->Append(new base::StringValue("udp-send-to::8888"));
+ value->Append(new base::StringValue("udp-send-to::8899"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
apis2.insert(permission);
@@ -436,8 +432,8 @@ TEST(PermissionsTest, CreateIntersection) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(base::Value::CreateStringValue("udp-bind::8080"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8888"));
+ value->Append(new base::StringValue("udp-bind::8080"));
+ value->Append(new base::StringValue("udp-send-to::8888"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
expected_apis.insert(permission);
@@ -500,10 +496,9 @@ TEST(PermissionsTest, CreateDifference) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(
- base::Value::CreateStringValue("tcp-connect:*.example.com:80"));
- value->Append(base::Value::CreateStringValue("udp-bind::8080"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8888"));
+ value->Append(new base::StringValue("tcp-connect:*.example.com:80"));
+ value->Append(new base::StringValue("udp-bind::8080"));
+ value->Append(new base::StringValue("udp-send-to::8888"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
apis1.insert(permission);
@@ -526,9 +521,8 @@ TEST(PermissionsTest, CreateDifference) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(
- base::Value::CreateStringValue("tcp-connect:*.example.com:80"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8899"));
+ value->Append(new base::StringValue("tcp-connect:*.example.com:80"));
+ value->Append(new base::StringValue("udp-send-to::8899"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
apis2.insert(permission);
@@ -537,8 +531,8 @@ TEST(PermissionsTest, CreateDifference) {
permission = permission_info->CreateAPIPermission();
{
scoped_ptr<base::ListValue> value(new base::ListValue());
- value->Append(base::Value::CreateStringValue("udp-bind::8080"));
- value->Append(base::Value::CreateStringValue("udp-send-to::8888"));
+ value->Append(new base::StringValue("udp-bind::8080"));
+ value->Append(new base::StringValue("udp-send-to::8888"));
ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
}
expected_apis.insert(permission);
« no previous file with comments | « chrome/browser/ui/webui/policy_ui_browsertest.cc ('k') | chrome/renderer/chrome_content_renderer_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698