| Index: chrome/browser/download/download_manager_unittest.cc
|
| diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc
|
| index 210788d02f2b805e9302f78b0276fe8357cecb4a..2d2ba5be8eef9eb4549378245ee706c18527dd25 100644
|
| --- a/chrome/browser/download/download_manager_unittest.cc
|
| +++ b/chrome/browser/download/download_manager_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include <string>
|
|
|
| #include "base/string_util.h"
|
| +#include "base/prebind.h"
|
| #include "build/build_config.h"
|
| #include "chrome/browser/browser_thread.h"
|
| #include "chrome/browser/download/download_file.h"
|
| @@ -18,7 +19,6 @@
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/test/testing_profile.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| -#include "testing/gmock_mutant.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| class MockDownloadManager : public DownloadManager {
|
| @@ -209,7 +209,6 @@ class MockDownloadFile : public DownloadFile {
|
|
|
| TEST_F(DownloadManagerTest, DownloadRenameTest) {
|
| using ::testing::_;
|
| - using ::testing::CreateFunctor;
|
| using ::testing::Invoke;
|
| using ::testing::Return;
|
|
|
| @@ -235,13 +234,15 @@ TEST_F(DownloadManagerTest, DownloadRenameTest) {
|
| } else {
|
| ASSERT_EQ(2, kDownloadRenameCases[i].expected_rename_count);
|
| FilePath crdownload(download_util::GetCrDownloadPath(new_path));
|
| + // Use tr1 bind to replace the "Mutant" calls with gmock. Demonstrates
|
| + // partial binding using placeholders.
|
| EXPECT_CALL(*download, Rename(_, _))
|
| - .WillOnce(testing::WithArgs<0, 1>(Invoke(CreateFunctor(
|
| - download, &MockDownloadFile::TestMultipleRename,
|
| - 1, false, crdownload))))
|
| - .WillOnce(testing::WithArgs<0, 1>(Invoke(CreateFunctor(
|
| - download, &MockDownloadFile::TestMultipleRename,
|
| - 2, true, new_path))));
|
| + .WillOnce(testing::WithArgs<0, 1>(Invoke(
|
| + base::Prebind(&MockDownloadFile::TestMultipleRename,
|
| + base::Unretained(download), 1, false, crdownload))))
|
| + .WillOnce(testing::WithArgs<0, 1>(Invoke(
|
| + base::Prebind(&MockDownloadFile::TestMultipleRename,
|
| + base::Unretained(download), 2, true, ::std::tr1::ref(new_path)))));
|
| }
|
|
|
| if (kDownloadRenameCases[i].will_delete_crdownload)
|
|
|