| 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/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
| 6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 #include "chrome/browser/extensions/autoupdate_interceptor.h" | 7 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 ASSERT_EQ(size_before + 1, service->extensions()->size()); | 406 ASSERT_EQ(size_before + 1, service->extensions()->size()); |
| 407 const Extension* extension = service->GetExtensionById(kExtensionId, false); | 407 const Extension* extension = service->GetExtensionById(kExtensionId, false); |
| 408 ASSERT_TRUE(extension); | 408 ASSERT_TRUE(extension); |
| 409 ASSERT_EQ("2.0", extension->VersionString()); | 409 ASSERT_EQ("2.0", extension->VersionString()); |
| 410 | 410 |
| 411 // Uninstalling the extension should set a pref that keeps the extension from | 411 // Uninstalling the extension should set a pref that keeps the extension from |
| 412 // being installed again the next time external_extensions.json is read. | 412 // being installed again the next time external_extensions.json is read. |
| 413 | 413 |
| 414 UninstallExtension(kExtensionId); | 414 UninstallExtension(kExtensionId); |
| 415 | 415 |
| 416 ExtensionPrefs* extension_prefs = service->extension_prefs(); | 416 extensions::ExtensionPrefs* extension_prefs = service->extension_prefs(); |
| 417 EXPECT_TRUE(extension_prefs->IsExternalExtensionUninstalled(kExtensionId)) | 417 EXPECT_TRUE(extension_prefs->IsExternalExtensionUninstalled(kExtensionId)) |
| 418 << "Uninstalling should set kill bit on externaly installed extension."; | 418 << "Uninstalling should set kill bit on externaly installed extension."; |
| 419 | 419 |
| 420 // Try to install the extension again from an external source. It should fail | 420 // Try to install the extension again from an external source. It should fail |
| 421 // because of the killbit. | 421 // because of the killbit. |
| 422 EXPECT_FALSE(pending_extension_manager->AddFromExternalUpdateUrl( | 422 EXPECT_FALSE(pending_extension_manager->AddFromExternalUpdateUrl( |
| 423 kExtensionId, GURL("http://localhost/autoupdate/manifest"), | 423 kExtensionId, GURL("http://localhost/autoupdate/manifest"), |
| 424 Extension::EXTERNAL_PREF_DOWNLOAD)); | 424 Extension::EXTERNAL_PREF_DOWNLOAD)); |
| 425 EXPECT_FALSE(pending_extension_manager->IsIdPending(kExtensionId)) | 425 EXPECT_FALSE(pending_extension_manager->IsIdPending(kExtensionId)) |
| 426 << "External reinstall of a killed extension shouldn't work."; | 426 << "External reinstall of a killed extension shouldn't work."; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 std::string(kExtensionId) + ";http://localhost/autoupdate/manifest")); | 611 std::string(kExtensionId) + ";http://localhost/autoupdate/manifest")); |
| 612 } | 612 } |
| 613 ASSERT_TRUE(WaitForExtensionInstall()); | 613 ASSERT_TRUE(WaitForExtensionInstall()); |
| 614 ASSERT_EQ(size_before + 1, service->extensions()->size()); | 614 ASSERT_EQ(size_before + 1, service->extensions()->size()); |
| 615 extension = service->GetExtensionById(kExtensionId, false); | 615 extension = service->GetExtensionById(kExtensionId, false); |
| 616 ASSERT_TRUE(extension); | 616 ASSERT_TRUE(extension); |
| 617 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, extension->location()); | 617 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, extension->location()); |
| 618 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); | 618 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); |
| 619 EXPECT_TRUE(service->disabled_extensions()->is_empty()); | 619 EXPECT_TRUE(service->disabled_extensions()->is_empty()); |
| 620 } | 620 } |
| OLD | NEW |