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

Side by Side Diff: chrome/browser/background/background_application_list_model_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // TODO(rickcam): Bug 73183: Add unit tests for image loading 5 // TODO(rickcam): Bug 73183: Add unit tests for image loading
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <set> 8 #include <set>
9 9
10 #include "chrome/browser/background/background_application_list_model.h" 10 #include "chrome/browser/background/background_application_list_model.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 static scoped_refptr<Extension> CreateExtensionBase( 74 static scoped_refptr<Extension> CreateExtensionBase(
75 const std::string& name, 75 const std::string& name,
76 bool background_permission, 76 bool background_permission,
77 PushMessagingOption push_messaging) { 77 PushMessagingOption push_messaging) {
78 base::DictionaryValue manifest; 78 base::DictionaryValue manifest;
79 manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); 79 manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0");
80 manifest.SetString(extensions::manifest_keys::kName, name); 80 manifest.SetString(extensions::manifest_keys::kName, name);
81 base::ListValue* permissions = new base::ListValue(); 81 base::ListValue* permissions = new base::ListValue();
82 manifest.Set(extensions::manifest_keys::kPermissions, permissions); 82 manifest.Set(extensions::manifest_keys::kPermissions, permissions);
83 if (background_permission) { 83 if (background_permission) {
84 permissions->Append(base::Value::CreateStringValue("background")); 84 permissions->Append(new base::StringValue("background"));
85 } 85 }
86 if (push_messaging == PUSH_MESSAGING_PERMISSION || 86 if (push_messaging == PUSH_MESSAGING_PERMISSION ||
87 push_messaging == PUSH_MESSAGING_BUT_NOT_BACKGROUND) { 87 push_messaging == PUSH_MESSAGING_BUT_NOT_BACKGROUND) {
88 permissions->Append(base::Value::CreateStringValue("pushMessaging")); 88 permissions->Append(new base::StringValue("pushMessaging"));
89 } 89 }
90 90
91 std::string error; 91 std::string error;
92 scoped_refptr<Extension> extension; 92 scoped_refptr<Extension> extension;
93 93
94 // There is a whitelist for extensions that have pushMessaging permission but 94 // There is a whitelist for extensions that have pushMessaging permission but
95 // are not considered a background app. Create a test extension with a known 95 // are not considered a background app. Create a test extension with a known
96 // test id if needed. 96 // test id if needed.
97 if (push_messaging == PUSH_MESSAGING_BUT_NOT_BACKGROUND) { 97 if (push_messaging == PUSH_MESSAGING_BUT_NOT_BACKGROUND) {
98 extension = Extension::Create( 98 extension = Extension::Create(
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 break; 502 break;
503 case 2: 503 case 2:
504 TogglePermission(service, &extensions, model.get(), &expected, &count); 504 TogglePermission(service, &extensions, model.get(), &expected, &count);
505 break; 505 break;
506 default: 506 default:
507 NOTREACHED(); 507 NOTREACHED();
508 break; 508 break;
509 } 509 }
510 } 510 }
511 } 511 }
OLDNEW
« no previous file with comments | « cc/resources/tile_priority.cc ('k') | chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698