| 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 "chrome/browser/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 .AppendASCII("Extensions") | 633 .AppendASCII("Extensions") |
| 634 .AppendASCII(good2) | 634 .AppendASCII(good2) |
| 635 .AppendASCII("1.0"); | 635 .AppendASCII("1.0"); |
| 636 } | 636 } |
| 637 | 637 |
| 638 void TestExternalProvider(MockExtensionProvider* provider, | 638 void TestExternalProvider(MockExtensionProvider* provider, |
| 639 Manifest::Location location); | 639 Manifest::Location location); |
| 640 | 640 |
| 641 void BlackListWebGL() { | 641 void BlackListWebGL() { |
| 642 static const std::string json_blacklist = | 642 static const std::string json_blacklist = |
| 643 "{\n" | 643 "{\n" |
| 644 " \"name\": \"gpu blacklist\",\n" | 644 " \"name\": \"gpu blacklist\",\n" |
| 645 " \"version\": \"1.0\",\n" | 645 " \"version\": \"1.0\",\n" |
| 646 " \"entries\": [\n" | 646 " \"entries\": [\n" |
| 647 " {\n" | 647 " {\n" |
| 648 " \"id\": 1,\n" | 648 " \"id\": 1,\n" |
| 649 " \"features\": [\"webgl\"]\n" | 649 " \"features\": [\"accelerated_webgl\"]\n" |
| 650 " }\n" | 650 " }\n" |
| 651 " ]\n" | 651 " ]\n" |
| 652 "}"; | 652 "}"; |
| 653 gpu::GPUInfo gpu_info; | 653 gpu::GPUInfo gpu_info; |
| 654 content::GpuDataManager::GetInstance()->InitializeForTesting( | 654 content::GpuDataManager::GetInstance()->InitializeForTesting( |
| 655 json_blacklist, gpu_info); | 655 json_blacklist, gpu_info); |
| 656 } | 656 } |
| 657 | 657 |
| 658 // Grants all optional permissions stated in manifest to active permission | 658 // Grants all optional permissions stated in manifest to active permission |
| 659 // set for extension |id|. | 659 // set for extension |id|. |
| 660 void GrantAllOptionalPermissions(const std::string& id) { | 660 void GrantAllOptionalPermissions(const std::string& id) { |
| 661 const Extension* extension = service()->GetInstalledExtension(id); | 661 const Extension* extension = service()->GetInstalledExtension(id); |
| 662 const PermissionSet& all_optional_permissions = | 662 const PermissionSet& all_optional_permissions = |
| (...skipping 6533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7196 shared_module->manifest()->type()); | 7196 shared_module->manifest()->type()); |
| 7197 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); | 7197 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); |
| 7198 | 7198 |
| 7199 // Reload the extension and wait for it to complete. This previously crashed | 7199 // Reload the extension and wait for it to complete. This previously crashed |
| 7200 // (see crbug.com/676815). | 7200 // (see crbug.com/676815). |
| 7201 service()->ReloadExtension(kExtensionId); | 7201 service()->ReloadExtension(kExtensionId); |
| 7202 base::RunLoop().RunUntilIdle(); | 7202 base::RunLoop().RunUntilIdle(); |
| 7203 // The shared module should be enabled. | 7203 // The shared module should be enabled. |
| 7204 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); | 7204 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); |
| 7205 } | 7205 } |
| OLD | NEW |