| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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->AppendString("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(bogus_file_pathname(name), |
| 93 bogus_file_pathname(name), | 93 extensions::Manifest::INTERNAL, manifest, |
| 94 extensions::Manifest::INVALID_LOCATION, | 94 Extension::NO_FLAGS, &error); |
| 95 manifest, | |
| 96 Extension::NO_FLAGS, | |
| 97 &error); | |
| 98 | 95 |
| 99 // Cannot ASSERT_* here because that attempts an illegitimate return. | 96 // Cannot ASSERT_* here because that attempts an illegitimate return. |
| 100 // Cannot EXPECT_NE here because that assumes non-pointers unlike EXPECT_EQ | 97 // Cannot EXPECT_NE here because that assumes non-pointers unlike EXPECT_EQ |
| 101 EXPECT_TRUE(extension.get() != NULL) << error; | 98 EXPECT_TRUE(extension.get() != NULL) << error; |
| 102 return extension; | 99 return extension; |
| 103 } | 100 } |
| 104 | 101 |
| 105 namespace { | 102 namespace { |
| 106 std::string GenerateUniqueExtensionName() { | 103 std::string GenerateUniqueExtensionName() { |
| 107 static int uniqueness = 0; | 104 static int uniqueness = 0; |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 case 2: | 392 case 2: |
| 396 TogglePermission(service(), &extensions, model.get(), &expected, | 393 TogglePermission(service(), &extensions, model.get(), &expected, |
| 397 &count); | 394 &count); |
| 398 break; | 395 break; |
| 399 default: | 396 default: |
| 400 NOTREACHED(); | 397 NOTREACHED(); |
| 401 break; | 398 break; |
| 402 } | 399 } |
| 403 } | 400 } |
| 404 } | 401 } |
| OLD | NEW |