| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <list> | 5 #include <list> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 ExtensionService* service = system->extension_service(); | 609 ExtensionService* service = system->extension_service(); |
| 610 | 610 |
| 611 // The id of our test extension. | 611 // The id of our test extension. |
| 612 std::string id("npnbmohejbjohgpjnmjagbafnjhkmgko"); | 612 std::string id("npnbmohejbjohgpjnmjagbafnjhkmgko"); |
| 613 | 613 |
| 614 // Setup fake policy and update check objects. | 614 // Setup fake policy and update check objects. |
| 615 ForceInstallProvider policy(id); | 615 ForceInstallProvider policy(id); |
| 616 DownloaderTestDelegate downloader; | 616 DownloaderTestDelegate downloader; |
| 617 system->management_policy()->RegisterProvider(&policy); | 617 system->management_policy()->RegisterProvider(&policy); |
| 618 ExtensionDownloader::set_test_delegate(&downloader); | 618 ExtensionDownloader::set_test_delegate(&downloader); |
| 619 service->AddProviderForTesting( | 619 service->AddProviderForTesting(new TestExternalProvider(service, id)); |
| 620 base::MakeUnique<TestExternalProvider>(service, id)); | |
| 621 | 620 |
| 622 base::FilePath crx_path = | 621 base::FilePath crx_path = |
| 623 test_data_dir_.AppendASCII("content_verifier/v1.crx"); | 622 test_data_dir_.AppendASCII("content_verifier/v1.crx"); |
| 624 const Extension* extension = | 623 const Extension* extension = |
| 625 InstallExtension(crx_path, 1, Manifest::EXTERNAL_POLICY_DOWNLOAD); | 624 InstallExtension(crx_path, 1, Manifest::EXTERNAL_POLICY_DOWNLOAD); |
| 626 EXPECT_NE(extension, nullptr); | 625 EXPECT_NE(extension, nullptr); |
| 627 | 626 |
| 628 downloader.AddResponse(id, extension->VersionString(), crx_path); | 627 downloader.AddResponse(id, extension->VersionString(), crx_path); |
| 629 | 628 |
| 630 RegistryObserver registry_observer(ExtensionRegistry::Get(profile())); | 629 RegistryObserver registry_observer(ExtensionRegistry::Get(profile())); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 656 found = true; | 655 found = true; |
| 657 EXPECT_NE(std::string::npos, part.find("installsource%3Dreinstall")); | 656 EXPECT_NE(std::string::npos, part.find("installsource%3Dreinstall")); |
| 658 } | 657 } |
| 659 } | 658 } |
| 660 } | 659 } |
| 661 } | 660 } |
| 662 EXPECT_TRUE(found); | 661 EXPECT_TRUE(found); |
| 663 } | 662 } |
| 664 | 663 |
| 665 } // namespace extensions | 664 } // namespace extensions |
| OLD | NEW |