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

Side by Side Diff: components/suggestions/image_manager_unittest.cc

Issue 649793002: [Suggestions] Headers cleanup for iOS image encoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « components/suggestions/image_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "components/leveldb_proto/proto_database.h" 9 #include "components/leveldb_proto/proto_database.h"
10 #include "components/leveldb_proto/testing/fake_db.h" 10 #include "components/leveldb_proto/testing/fake_db.h"
11 #include "components/suggestions/image_encoder.h"
11 #include "components/suggestions/image_fetcher.h" 12 #include "components/suggestions/image_fetcher.h"
12 #include "components/suggestions/image_fetcher_delegate.h" 13 #include "components/suggestions/image_fetcher_delegate.h"
13 #include "components/suggestions/image_manager.h" 14 #include "components/suggestions/image_manager.h"
14 #include "components/suggestions/proto/suggestions.pb.h" 15 #include "components/suggestions/proto/suggestions.pb.h"
15 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 #include "ui/gfx/image/image_skia.h" 18 #include "ui/gfx/image/image_skia.h"
18 #include "url/gurl.h" 19 #include "url/gurl.h"
19 20
20 #if defined(OS_IOS)
21 #include "components/suggestions/image_encoder_ios.h"
22 #else
23 #include "components/suggestions/image_encoder.h"
24 #endif
25
26 using ::testing::Return; 21 using ::testing::Return;
27 using ::testing::StrictMock; 22 using ::testing::StrictMock;
28 using ::testing::_; 23 using ::testing::_;
29 24
30 namespace suggestions { 25 namespace suggestions {
31 26
32 const char kTestUrl1[] = "http://go.com/"; 27 const char kTestUrl1[] = "http://go.com/";
33 const char kTestUrl2[] = "http://goal.com/"; 28 const char kTestUrl2[] = "http://goal.com/";
34 const char kTestImagePath[] = "files/image_decoding/droids.png"; 29 const char kTestImagePath[] = "files/image_decoding/droids.png";
35 const char kInvalidImagePath[] = "files/DOESNOTEXIST"; 30 const char kInvalidImagePath[] = "files/DOESNOTEXIST";
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 image_manager_->GetImageForURL(GURL(kTestUrl1), 188 image_manager_->GetImageForURL(GURL(kTestUrl1),
194 base::Bind(&ImageManagerTest::OnImageAvailable, 189 base::Bind(&ImageManagerTest::OnImageAvailable,
195 base::Unretained(this), &run_loop)); 190 base::Unretained(this), &run_loop));
196 run_loop.Run(); 191 run_loop.Run();
197 192
198 EXPECT_EQ(0, num_callback_null_called_); 193 EXPECT_EQ(0, num_callback_null_called_);
199 EXPECT_EQ(1, num_callback_valid_called_); 194 EXPECT_EQ(1, num_callback_valid_called_);
200 } 195 }
201 196
202 } // namespace suggestions 197 } // namespace suggestions
OLDNEW
« no previous file with comments | « components/suggestions/image_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698