| Index: chrome/browser/extensions/updater/extension_updater_unittest.cc
|
| diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
|
| index c128629e3bea842b85d71e1a1819d2b7142580fa..1a2a70b7ea8dd9b478f16eb4ba008ec6bf2f57a0 100644
|
| --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
|
| +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
|
| @@ -2,12 +2,14 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "chrome/browser/extensions/updater/extension_updater.h"
|
| +
|
| #include <stddef.h>
|
| #include <stdint.h>
|
| -
|
| #include <list>
|
| #include <map>
|
| #include <set>
|
| +#include <utility>
|
| #include <vector>
|
|
|
| #include "base/bind.h"
|
| @@ -37,7 +39,6 @@
|
| #include "chrome/browser/extensions/test_extension_service.h"
|
| #include "chrome/browser/extensions/test_extension_system.h"
|
| #include "chrome/browser/extensions/updater/chrome_extension_downloader_factory.h"
|
| -#include "chrome/browser/extensions/updater/extension_updater.h"
|
| #include "chrome/browser/google/google_brand.h"
|
| #include "chrome/test/base/scoped_testing_local_state.h"
|
| #include "chrome/test/base/testing_browser_process.h"
|
| @@ -381,7 +382,7 @@ class MockService : public TestExtensionService {
|
| : delegate);
|
| if (enable_metrics_)
|
| downloader->set_enable_extra_update_metrics(true);
|
| - return downloader.Pass();
|
| + return downloader;
|
| }
|
|
|
| scoped_ptr<ExtensionDownloader> CreateExtensionDownloaderWithIdentity(
|
| @@ -395,8 +396,8 @@ class MockService : public TestExtensionService {
|
|
|
| scoped_ptr<ExtensionDownloader> downloader(
|
| CreateExtensionDownloader(delegate));
|
| - downloader->SetWebstoreIdentityProvider(fake_identity_provider.Pass());
|
| - return downloader.Pass();
|
| + downloader->SetWebstoreIdentityProvider(std::move(fake_identity_provider));
|
| + return downloader;
|
| }
|
|
|
| scoped_ptr<FakeOAuth2TokenService> fake_token_service_;
|
| @@ -960,10 +961,10 @@ class ExtensionUpdaterTest : public testing::Test {
|
| GURL fetch2_url = fetch2->full_url();
|
| GURL fetch3_url = fetch3->full_url();
|
| GURL fetch4_url = fetch4->full_url();
|
| - downloader.StartUpdateCheck(fetch1.Pass());
|
| - downloader.StartUpdateCheck(fetch2.Pass());
|
| - downloader.StartUpdateCheck(fetch3.Pass());
|
| - downloader.StartUpdateCheck(fetch4.Pass());
|
| + downloader.StartUpdateCheck(std::move(fetch1));
|
| + downloader.StartUpdateCheck(std::move(fetch2));
|
| + downloader.StartUpdateCheck(std::move(fetch3));
|
| + downloader.StartUpdateCheck(std::move(fetch4));
|
| RunUntilIdle();
|
|
|
| for (int i = 0; i < 4; ++i) {
|
| @@ -1085,7 +1086,7 @@ class ExtensionUpdaterTest : public testing::Test {
|
| std::string());
|
|
|
| // This will start the first fetcher.
|
| - downloader.StartUpdateCheck(fetch.Pass());
|
| + downloader.StartUpdateCheck(std::move(fetch));
|
| RunUntilIdle();
|
|
|
| // ExtensionDownloader should retry kMaxRetries times and then fail.
|
| @@ -1113,7 +1114,7 @@ class ExtensionUpdaterTest : public testing::Test {
|
| std::string());
|
|
|
| // This will start the first fetcher.
|
| - downloader.StartUpdateCheck(fetch.Pass());
|
| + downloader.StartUpdateCheck(std::move(fetch));
|
| RunUntilIdle();
|
|
|
| EXPECT_CALL(delegate, OnExtensionDownloadFailed(
|
| @@ -1172,7 +1173,7 @@ class ExtensionUpdaterTest : public testing::Test {
|
| scoped_ptr<ExtensionDownloader::ExtensionFetch> fetch(
|
| new ExtensionDownloader::ExtensionFetch(
|
| id, test_url, hash, version.GetString(), requests));
|
| - updater.downloader_->FetchUpdatedExtension(fetch.Pass());
|
| + updater.downloader_->FetchUpdatedExtension(std::move(fetch));
|
|
|
| if (pending) {
|
| const bool kIsFromSync = true;
|
| @@ -1282,7 +1283,7 @@ class ExtensionUpdaterTest : public testing::Test {
|
| scoped_ptr<ExtensionDownloader::ExtensionFetch> fetch(
|
| new ExtensionDownloader::ExtensionFetch(
|
| id, test_url, hash, version.GetString(), requests));
|
| - updater.downloader_->FetchUpdatedExtension(fetch.Pass());
|
| + updater.downloader_->FetchUpdatedExtension(std::move(fetch));
|
|
|
| fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId);
|
| EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
|
| @@ -1475,8 +1476,8 @@ class ExtensionUpdaterTest : public testing::Test {
|
| scoped_ptr<ExtensionDownloader::ExtensionFetch> fetch2(
|
| new ExtensionDownloader::ExtensionFetch(
|
| id2, url2, hash2, version2, requests));
|
| - updater.downloader_->FetchUpdatedExtension(fetch1.Pass());
|
| - updater.downloader_->FetchUpdatedExtension(fetch2.Pass());
|
| + updater.downloader_->FetchUpdatedExtension(std::move(fetch1));
|
| + updater.downloader_->FetchUpdatedExtension(std::move(fetch2));
|
|
|
| // Make the first fetch complete.
|
| base::FilePath extension_file_path(FILE_PATH_LITERAL("/whatever"));
|
|
|