| 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 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/download/download_crx_util.h" | 8 #include "chrome/browser/download/download_crx_util.h" |
| 9 #include "chrome/browser/extensions/browser_action_test_util.h" | 9 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 10 #include "chrome/browser/extensions/crx_installer.h" | 10 #include "chrome/browser/extensions/crx_installer.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 const extensions::Extension* extension = | 390 const extensions::Extension* extension = |
| 391 service->GetExtensionById(extension_id, false); | 391 service->GetExtensionById(extension_id, false); |
| 392 ASSERT_TRUE(extension); | 392 ASSERT_TRUE(extension); |
| 393 EXPECT_EQ(extension_id, extension->id()); | 393 EXPECT_EQ(extension_id, extension->id()); |
| 394 | 394 |
| 395 UninstallExtension(extension_id); | 395 UninstallExtension(extension_id); |
| 396 EXPECT_FALSE(service->GetExtensionById(extension_id, false)); | 396 EXPECT_FALSE(service->GetExtensionById(extension_id, false)); |
| 397 } | 397 } |
| 398 | 398 |
| 399 // See http://crbug.com/315299. | 399 // See http://crbug.com/315299. |
| 400 #if defined(OS_WIN) | 400 #if defined(OS_WIN) || defined(OS_LINUX) |
| 401 #define MAYBE_InstallDelayedUntilNextUpdate \ | 401 #define MAYBE_InstallDelayedUntilNextUpdate \ |
| 402 DISABLED_InstallDelayedUntilNextUpdate | 402 DISABLED_InstallDelayedUntilNextUpdate |
| 403 #else | 403 #else |
| 404 #define MAYBE_InstallDelayedUntilNextUpdate InstallDelayedUntilNextUpdate | 404 #define MAYBE_InstallDelayedUntilNextUpdate InstallDelayedUntilNextUpdate |
| 405 #endif // defined(OS_WIN) | 405 #endif |
| 406 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, | 406 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, |
| 407 MAYBE_InstallDelayedUntilNextUpdate) { | 407 MAYBE_InstallDelayedUntilNextUpdate) { |
| 408 const std::string extension_id("ldnnhddmnhbkjipkidpdiheffobcpfmf"); | 408 const std::string extension_id("ldnnhddmnhbkjipkidpdiheffobcpfmf"); |
| 409 base::FilePath crx_path = test_data_dir_.AppendASCII("delayed_install"); | 409 base::FilePath crx_path = test_data_dir_.AppendASCII("delayed_install"); |
| 410 ExtensionSystem* extension_system = extensions::ExtensionSystem::Get( | 410 ExtensionSystem* extension_system = extensions::ExtensionSystem::Get( |
| 411 browser()->profile()); | 411 browser()->profile()); |
| 412 ExtensionService* service = extension_system->extension_service(); | 412 ExtensionService* service = extension_system->extension_service(); |
| 413 ASSERT_TRUE(service); | 413 ASSERT_TRUE(service); |
| 414 | 414 |
| 415 // Install version 1 of the test extension. This extension does not have | 415 // Install version 1 of the test extension. This extension does not have |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 ManagementPolicyMock policy; | 571 ManagementPolicyMock policy; |
| 572 extensions::ExtensionSystem::Get(profile()) | 572 extensions::ExtensionSystem::Get(profile()) |
| 573 ->management_policy() | 573 ->management_policy() |
| 574 ->RegisterProvider(&policy); | 574 ->RegisterProvider(&policy); |
| 575 | 575 |
| 576 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); | 576 base::FilePath crx_path = test_data_dir_.AppendASCII("crx_installer/v1.crx"); |
| 577 EXPECT_FALSE(InstallExtension(crx_path, 0)); | 577 EXPECT_FALSE(InstallExtension(crx_path, 0)); |
| 578 } | 578 } |
| 579 | 579 |
| 580 } // namespace extensions | 580 } // namespace extensions |
| OLD | NEW |