Commit 00ef9a1f authored by Chris Mumford's avatar Chris Mumford Committed by Commit Bot

tts: Removed use of functor in test.

TtsApiTest.PlatformSpeakError used testing::CreateFunctor which
was unnecessary because gmock's testing::InvokeWithoutArgs
currently supports invoking a method of an object. Making this
change simplifies the test as well as an upcoming change
to gmock_mutant.h.

Bug: 1007833, 806952
Change-Id: Id8dbd560ba1233ba2288e8179b0aced29d02a110
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874052Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708688}
parent c36a4af6
...@@ -27,11 +27,9 @@ ...@@ -27,11 +27,9 @@
#include "extensions/browser/notification_types.h" #include "extensions/browser/notification_types.h"
#include "net/base/network_change_notifier.h" #include "net/base/network_change_notifier.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gmock_mutant.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
using ::testing::AnyNumber; using ::testing::AnyNumber;
using ::testing::CreateFunctor;
using ::testing::DoAll; using ::testing::DoAll;
using ::testing::Invoke; using ::testing::Invoke;
using ::testing::InSequence; using ::testing::InSequence;
...@@ -395,10 +393,10 @@ IN_PROC_BROWSER_TEST_F(TtsApiTest, PlatformSpeakError) { ...@@ -395,10 +393,10 @@ IN_PROC_BROWSER_TEST_F(TtsApiTest, PlatformSpeakError) {
EXPECT_CALL(mock_platform_impl_, StopSpeaking()) EXPECT_CALL(mock_platform_impl_, StopSpeaking())
.WillOnce(Return(true)); .WillOnce(Return(true));
EXPECT_CALL(mock_platform_impl_, DoSpeak(_, "first try", _, _, _)) EXPECT_CALL(mock_platform_impl_, DoSpeak(_, "first try", _, _, _))
.WillOnce(DoAll(InvokeWithoutArgs(CreateFunctor( .WillOnce(
&MockTtsPlatformImpl::SetErrorToEpicFail, DoAll(InvokeWithoutArgs(&mock_platform_impl_,
base::Unretained(&mock_platform_impl_))), &MockTtsPlatformImpl::SetErrorToEpicFail),
Return())); Return()));
EXPECT_CALL(mock_platform_impl_, StopSpeaking()) EXPECT_CALL(mock_platform_impl_, StopSpeaking())
.WillOnce(Return(true)); .WillOnce(Return(true));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment