| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 #else | 617 #else |
| 618 #define MAYBE_PolicyOverridesUserInstall PolicyOverridesUserInstall | 618 #define MAYBE_PolicyOverridesUserInstall PolicyOverridesUserInstall |
| 619 #endif | 619 #endif |
| 620 | 620 |
| 621 IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, | 621 IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, |
| 622 MAYBE_PolicyOverridesUserInstall) { | 622 MAYBE_PolicyOverridesUserInstall) { |
| 623 ExtensionService* service = extensions::ExtensionSystem::Get( | 623 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 624 browser()->profile())->extension_service(); | 624 browser()->profile())->extension_service(); |
| 625 ExtensionRegistry* registry = ExtensionRegistry::Get(browser()->profile()); | 625 ExtensionRegistry* registry = ExtensionRegistry::Get(browser()->profile()); |
| 626 const char kExtensionId[] = "ogjcoiohnmldgjemafoockdghcjciccf"; | 626 const char kExtensionId[] = "ogjcoiohnmldgjemafoockdghcjciccf"; |
| 627 extensions::ExtensionUpdater::CheckParams params; | |
| 628 service->updater()->set_default_check_params(params); | |
| 629 const size_t size_before = registry->enabled_extensions().size(); | 627 const size_t size_before = registry->enabled_extensions().size(); |
| 630 base::FilePath basedir = test_data_dir_.AppendASCII("autoupdate"); | 628 base::FilePath basedir = test_data_dir_.AppendASCII("autoupdate"); |
| 631 ASSERT_TRUE(registry->disabled_extensions().is_empty()); | 629 ASSERT_TRUE(registry->disabled_extensions().is_empty()); |
| 632 | 630 |
| 633 // Note: This interceptor gets requests on the IO thread. | 631 // Note: This interceptor gets requests on the IO thread. |
| 634 net::LocalHostTestURLRequestInterceptor interceptor( | 632 net::LocalHostTestURLRequestInterceptor interceptor( |
| 635 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 633 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 636 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( | 634 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( |
| 637 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 635 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 638 | 636 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 UpdateProviderPolicy(policies); | 714 UpdateProviderPolicy(policies); |
| 717 extension_observer.WaitForExtensionWillBeInstalled(); | 715 extension_observer.WaitForExtensionWillBeInstalled(); |
| 718 | 716 |
| 719 ASSERT_EQ(size_before + 1, registry->enabled_extensions().size()); | 717 ASSERT_EQ(size_before + 1, registry->enabled_extensions().size()); |
| 720 extension = service->GetExtensionById(kExtensionId, false); | 718 extension = service->GetExtensionById(kExtensionId, false); |
| 721 ASSERT_TRUE(extension); | 719 ASSERT_TRUE(extension); |
| 722 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, extension->location()); | 720 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, extension->location()); |
| 723 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); | 721 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); |
| 724 EXPECT_TRUE(registry->disabled_extensions().is_empty()); | 722 EXPECT_TRUE(registry->disabled_extensions().is_empty()); |
| 725 } | 723 } |
| OLD | NEW |