Skip to content

Commit

Permalink
[Code health] Convert base::Bind in gallery_watch_manager_unittest.cc
Browse files Browse the repository at this point in the history
This CL converts three base::Bind to base::BindOnce in this file.
The function that takes the callback is already expecting a
OnceCallback, so converting to base::BindOnce seems to be the right
choice.

Bug: 1152278
Change-Id: I0ed76be834d516ccdcb20200b30f172fa41f385a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2592012
Reviewed-by: Tommy Li <tommycli@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837150}
  • Loading branch information
xidachen authored and Chromium LUCI CQ committed Dec 15, 2020
1 parent 73c16eb commit 8ed8125
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions chrome/browser/media_galleries/gallery_watch_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ class GalleryWatchManagerTest : public GalleryWatchManagerObserver,

void AddAndConfirmWatch(MediaGalleryPrefId gallery_id) {
base::RunLoop loop;
manager()->AddWatch(profile(),
extension(),
gallery_id,
base::Bind(&ConfirmWatch, base::Unretained(&loop)));
manager()->AddWatch(profile(), extension(), gallery_id,
base::BindOnce(&ConfirmWatch, base::Unretained(&loop)));
loop.Run();
}

Expand Down Expand Up @@ -230,18 +228,13 @@ TEST_F(GalleryWatchManagerTest, MAYBE_Basic) {

base::RunLoop loop;
if (GalleryWatchesSupported()) {
manager()->AddWatch(profile(),
extension(),
id,
base::Bind(&ConfirmWatch, base::Unretained(&loop)));
manager()->AddWatch(profile(), extension(), id,
base::BindOnce(&ConfirmWatch, base::Unretained(&loop)));
} else {
manager()->AddWatch(
profile(),
extension(),
id,
base::Bind(&ExpectWatchError,
base::Unretained(&loop),
GalleryWatchManager::kCouldNotWatchGalleryError));
profile(), extension(), id,
base::BindOnce(&ExpectWatchError, base::Unretained(&loop),
GalleryWatchManager::kCouldNotWatchGalleryError));
}
loop.Run();
}
Expand Down

0 comments on commit 8ed8125

Please sign in to comment.