Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Unified Diff: chrome/browser/extensions/updater/extension_updater_unittest.cc

Issue 1549233002: Convert Pass()→std::move() in //chrome/browser/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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"));

Powered by Google App Engine
This is Rietveld 408576698