| 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 4304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4315 observer.Wait(); | 4315 observer.Wait(); |
| 4316 | 4316 |
| 4317 ASSERT_EQ(1u, registry()->enabled_extensions().size()); | 4317 ASSERT_EQ(1u, registry()->enabled_extensions().size()); |
| 4318 EXPECT_TRUE(service()->GetExtensionById(good_crx, false)); | 4318 EXPECT_TRUE(service()->GetExtensionById(good_crx, false)); |
| 4319 const Extension* extension = service()->GetExtensionById(good_crx, false); | 4319 const Extension* extension = service()->GetExtensionById(good_crx, false); |
| 4320 EXPECT_TRUE(extension->from_webstore()); | 4320 EXPECT_TRUE(extension->from_webstore()); |
| 4321 EXPECT_TRUE(extension->was_installed_by_default()); | 4321 EXPECT_TRUE(extension->was_installed_by_default()); |
| 4322 } | 4322 } |
| 4323 #endif | 4323 #endif |
| 4324 | 4324 |
| 4325 TEST_F(ExtensionServiceTest, UpdatingPendingExternalExtensionWithFlags) { | 4325 // Crashes on Linux/CrOS. https://crbug.com/703712 |
| 4326 #if defined(OS_LINUX) || defined(OS_CHROMEOS) |
| 4327 #define MAYBE_UpdatingPendingExternalExtensionWithFlags \ |
| 4328 DISABLED_UpdatingPendingExternalExtensionWithFlags |
| 4329 #else |
| 4330 #define MAYBE_UpdatingPendingExternalExtensionWithFlags \ |
| 4331 UpdatingPendingExternalExtensionWithFlags |
| 4332 #endif |
| 4333 |
| 4334 TEST_F(ExtensionServiceTest, MAYBE_UpdatingPendingExternalExtensionWithFlags) { |
| 4326 // Regression test for crbug.com/627522 | 4335 // Regression test for crbug.com/627522 |
| 4327 const char kPrefFromBookmark[] = "from_bookmark"; | 4336 const char kPrefFromBookmark[] = "from_bookmark"; |
| 4328 | 4337 |
| 4329 InitializeEmptyExtensionService(); | 4338 InitializeEmptyExtensionService(); |
| 4330 | 4339 |
| 4331 base::FilePath path = data_dir().AppendASCII("good.crx"); | 4340 base::FilePath path = data_dir().AppendASCII("good.crx"); |
| 4332 | 4341 |
| 4333 // Register and install an external extension. | 4342 // Register and install an external extension. |
| 4334 std::unique_ptr<base::Version> version(new base::Version("1.0.0.0")); | 4343 std::unique_ptr<base::Version> version(new base::Version("1.0.0.0")); |
| 4335 content::WindowedNotificationObserver observer( | 4344 content::WindowedNotificationObserver observer( |
| (...skipping 2802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7138 shared_module->manifest()->type()); | 7147 shared_module->manifest()->type()); |
| 7139 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); | 7148 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); |
| 7140 | 7149 |
| 7141 // Reload the extension and wait for it to complete. This previously crashed | 7150 // Reload the extension and wait for it to complete. This previously crashed |
| 7142 // (see crbug.com/676815). | 7151 // (see crbug.com/676815). |
| 7143 service()->ReloadExtension(kExtensionId); | 7152 service()->ReloadExtension(kExtensionId); |
| 7144 base::RunLoop().RunUntilIdle(); | 7153 base::RunLoop().RunUntilIdle(); |
| 7145 // The shared module should be enabled. | 7154 // The shared module should be enabled. |
| 7146 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); | 7155 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); |
| 7147 } | 7156 } |
| OLD | NEW |