OLD | NEW |
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 "chrome/browser/background/background_application_list_model.h" | 7 #include "chrome/browser/background/background_application_list_model.h" |
8 | 8 |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // |background_permission| is true. | 76 // |background_permission| is true. |
77 static scoped_refptr<Extension> CreateExtension( | 77 static scoped_refptr<Extension> CreateExtension( |
78 const std::string& name, | 78 const std::string& name, |
79 bool background_permission) { | 79 bool background_permission) { |
80 base::DictionaryValue manifest; | 80 base::DictionaryValue manifest; |
81 manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); | 81 manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); |
82 manifest.SetString(extensions::manifest_keys::kName, name); | 82 manifest.SetString(extensions::manifest_keys::kName, name); |
83 base::ListValue* permissions = new base::ListValue(); | 83 base::ListValue* permissions = new base::ListValue(); |
84 manifest.Set(extensions::manifest_keys::kPermissions, permissions); | 84 manifest.Set(extensions::manifest_keys::kPermissions, permissions); |
85 if (background_permission) { | 85 if (background_permission) { |
86 permissions->Append(new base::StringValue("background")); | 86 permissions->AppendString("background"); |
87 } | 87 } |
88 | 88 |
89 std::string error; | 89 std::string error; |
90 scoped_refptr<Extension> extension; | 90 scoped_refptr<Extension> extension; |
91 | 91 |
92 extension = Extension::Create( | 92 extension = Extension::Create( |
93 bogus_file_pathname(name), | 93 bogus_file_pathname(name), |
94 extensions::Manifest::INVALID_LOCATION, | 94 extensions::Manifest::INVALID_LOCATION, |
95 manifest, | 95 manifest, |
96 Extension::NO_FLAGS, | 96 Extension::NO_FLAGS, |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 case 2: | 395 case 2: |
396 TogglePermission(service(), &extensions, model.get(), &expected, | 396 TogglePermission(service(), &extensions, model.get(), &expected, |
397 &count); | 397 &count); |
398 break; | 398 break; |
399 default: | 399 default: |
400 NOTREACHED(); | 400 NOTREACHED(); |
401 break; | 401 break; |
402 } | 402 } |
403 } | 403 } |
404 } | 404 } |
OLD | NEW |