| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 ListBuilder permissions; | 61 ListBuilder permissions; |
| 62 if (!host_permissions.empty()) | 62 if (!host_permissions.empty()) |
| 63 permissions.Append(host_permissions); | 63 permissions.Append(host_permissions); |
| 64 | 64 |
| 65 return ExtensionBuilder() | 65 return ExtensionBuilder() |
| 66 .SetManifest(DictionaryBuilder() | 66 .SetManifest(DictionaryBuilder() |
| 67 .Set("name", id) | 67 .Set("name", id) |
| 68 .Set("description", "an extension") | 68 .Set("description", "an extension") |
| 69 .Set("manifest_version", 2) | 69 .Set("manifest_version", 2) |
| 70 .Set("version", "1.0.0") | 70 .Set("version", "1.0.0") |
| 71 .Set("permissions", std::move(permissions)) | 71 .Set("permissions", permissions.Build()) |
| 72 .Build()) | 72 .Build()) |
| 73 .SetLocation(location) | 73 .SetLocation(location) |
| 74 .SetID(id) | 74 .SetID(id) |
| 75 .Build(); | 75 .Build(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Checks that urls are properly restricted for the given extension. | 78 // Checks that urls are properly restricted for the given extension. |
| 79 void CheckRestrictedUrls(const Extension* extension, | 79 void CheckRestrictedUrls(const Extension* extension, |
| 80 bool block_chrome_urls) { | 80 bool block_chrome_urls) { |
| 81 // We log the name so we know _which_ extension failed here. | 81 // We log the name so we know _which_ extension failed here. |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 | 773 |
| 774 permissions_data->ClearTabSpecificPermissions(1); | 774 permissions_data->ClearTabSpecificPermissions(1); |
| 775 EXPECT_FALSE(permissions_data->GetTabSpecificPermissionsForTesting(1)); | 775 EXPECT_FALSE(permissions_data->GetTabSpecificPermissionsForTesting(1)); |
| 776 | 776 |
| 777 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 0)); | 777 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 0)); |
| 778 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 1)); | 778 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 1)); |
| 779 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 2)); | 779 EXPECT_TRUE(ScriptAllowedExclusivelyOnTab(extension.get(), no_urls, 2)); |
| 780 } | 780 } |
| 781 | 781 |
| 782 } // namespace extensions | 782 } // namespace extensions |
| OLD | NEW |