1111
1212#include " ash/scanner/fake_scanner_profile_scoped_delegate.h"
1313#include " ash/scanner/scanner_action_view_model.h"
14- #include " ash/scanner/scanner_command_delegate_impl.h"
1514#include " ash/scanner/scanner_metrics.h"
1615#include " base/memory/ref_counted_memory.h"
1716#include " base/memory/scoped_refptr.h"
@@ -59,8 +58,7 @@ TEST(ScannerSessionTest, FetchActionsForImageReturnsEmptyWhenDelegateErrors) {
5958 .WillOnce (RunOnceCallback<1 >(
6059 nullptr , manta::MantaStatus{
6160 .status_code = manta::MantaStatusCode::kInvalidInput }));
62- ScannerCommandDelegateImpl command_delegate (&delegate);
63- ScannerSession session (&delegate, &command_delegate);
61+ ScannerSession session (&delegate);
6462
6563 base::test::TestFuture<std::vector<ScannerActionViewModel>> future;
6664 session.FetchActionsForImage (nullptr , future.GetCallback ());
@@ -75,8 +73,7 @@ TEST(ScannerSessionTest,
7573 .WillOnce (RunOnceCallback<1 >(
7674 std::make_unique<manta::proto::ScannerOutput>(),
7775 manta::MantaStatus{.status_code = manta::MantaStatusCode::kOk }));
78- ScannerCommandDelegateImpl command_delegate (&delegate);
79- ScannerSession session (&delegate, &command_delegate);
76+ ScannerSession session (&delegate);
8077
8178 base::test::TestFuture<std::vector<ScannerActionViewModel>> future;
8279 session.FetchActionsForImage (nullptr , future.GetCallback ());
@@ -99,8 +96,7 @@ TEST(ScannerSessionTest, FetchActionsForImageRecordsNumberOfActionsMetrics) {
9996 .WillOnce (RunOnceCallback<1 >(
10097 std::move (output),
10198 manta::MantaStatus{.status_code = manta::MantaStatusCode::kOk }));
102- ScannerCommandDelegateImpl command_delegate (&delegate);
103- ScannerSession session (&delegate, &command_delegate);
99+ ScannerSession session (&delegate);
104100 session.FetchActionsForImage (nullptr , base::DoNothing ());
105101
106102 histogram_tester.ExpectBucketCount (
@@ -128,8 +124,7 @@ TEST(ScannerSessionTest, FetchActionsForImageNoActionRecordsMetrics) {
128124 .WillOnce (RunOnceCallback<1 >(
129125 std::move (output),
130126 manta::MantaStatus{.status_code = manta::MantaStatusCode::kOk }));
131- ScannerCommandDelegateImpl command_delegate (&delegate);
132- ScannerSession session (&delegate, &command_delegate);
127+ ScannerSession session (&delegate);
133128 session.FetchActionsForImage (nullptr , base::DoNothing ());
134129
135130 histogram_tester.ExpectBucketCount (
@@ -144,9 +139,7 @@ TEST(ScannerSessionTest, FetchActionsForImageRecordsTimerMetric) {
144139 FetchActionsForImageFuture future;
145140 FakeScannerProfileScopedDelegate delegate;
146141 EXPECT_CALL (delegate, FetchActionsForImage).WillOnce (InvokeFuture (future));
147-
148- ScannerCommandDelegateImpl command_delegate (&delegate);
149- ScannerSession session (&delegate, &command_delegate);
142+ ScannerSession session (&delegate);
150143 session.FetchActionsForImage (nullptr , base::DoNothing ());
151144 task_environment.FastForwardBy (base::Milliseconds (500 ));
152145 auto output = std::make_unique<manta::proto::ScannerOutput>();
@@ -172,8 +165,7 @@ TEST(ScannerSessionTest,
172165 .WillOnce (RunOnceCallback<1 >(
173166 std::move (output),
174167 manta::MantaStatus{.status_code = manta::MantaStatusCode::kOk }));
175- ScannerCommandDelegateImpl command_delegate (&delegate);
176- ScannerSession session (&delegate, &command_delegate);
168+ ScannerSession session (&delegate);
177169
178170 base::test::TestFuture<std::vector<ScannerActionViewModel>> future;
179171 session.FetchActionsForImage (nullptr , future.GetCallback ());
@@ -185,8 +177,7 @@ TEST(ScannerSessionTest, ResizesImageHeightToMaxEdge) {
185177 FakeScannerProfileScopedDelegate delegate;
186178 FetchActionsForImageFuture future;
187179 EXPECT_CALL (delegate, FetchActionsForImage).WillOnce (InvokeFuture (future));
188- ScannerCommandDelegateImpl command_delegate (&delegate);
189- ScannerSession session (&delegate, &command_delegate);
180+ ScannerSession session (&delegate);
190181
191182 scoped_refptr<base::RefCountedMemory> bytes =
192183 MakeJpegBytes (/* width=*/ 2300 , /* height=*/ 23000 );
@@ -204,8 +195,7 @@ TEST(ScannerSessionTest, ResizesImageWidthToMaxEdge) {
204195 FakeScannerProfileScopedDelegate delegate;
205196 FetchActionsForImageFuture future;
206197 EXPECT_CALL (delegate, FetchActionsForImage).WillOnce (InvokeFuture (future));
207- ScannerCommandDelegateImpl command_delegate (&delegate);
208- ScannerSession session (&delegate, &command_delegate);
198+ ScannerSession session (&delegate);
209199
210200 scoped_refptr<base::RefCountedMemory> bytes =
211201 MakeJpegBytes (/* width=*/ 23000 , /* height=*/ 2300 );
@@ -223,8 +213,7 @@ TEST(ScannerSessionTest, NoResizeIfWithinLimit) {
223213 FakeScannerProfileScopedDelegate delegate;
224214 FetchActionsForImageFuture future;
225215 EXPECT_CALL (delegate, FetchActionsForImage).WillOnce (InvokeFuture (future));
226- ScannerCommandDelegateImpl command_delegate (&delegate);
227- ScannerSession session (&delegate, &command_delegate);
216+ ScannerSession session (&delegate);
228217
229218 scoped_refptr<base::RefCountedMemory> bytes =
230219 MakeJpegBytes (/* width=*/ 1000 , /* height=*/ 1000 );
@@ -239,8 +228,7 @@ TEST(ScannerSessionTest, DoesNotResizeIfTotalPixelSizeLowerThanMax) {
239228 FakeScannerProfileScopedDelegate delegate;
240229 FetchActionsForImageFuture future;
241230 EXPECT_CALL (delegate, FetchActionsForImage).WillOnce (InvokeFuture (future));
242- ScannerCommandDelegateImpl command_delegate (&delegate);
243- ScannerSession session (&delegate, &command_delegate);
231+ ScannerSession session (&delegate);
244232
245233 scoped_refptr<base::RefCountedMemory> bytes =
246234 MakeJpegBytes (/* width=*/ 4600 , /* height=*/ 1100 );
0 commit comments