OLD | NEW |
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 "components/suggestions/image_manager.h" | 5 #include "components/suggestions/image_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
14 #include "components/image_fetcher/image_fetcher.h" | 14 #include "components/image_fetcher/image_fetcher.h" |
15 #include "components/image_fetcher/image_fetcher_delegate.h" | 15 #include "components/image_fetcher/image_fetcher_delegate.h" |
16 #include "components/leveldb_proto/proto_database.h" | 16 #include "components/leveldb_proto/proto_database.h" |
17 #include "components/leveldb_proto/testing/fake_db.h" | 17 #include "components/leveldb_proto/testing/fake_db.h" |
18 #include "components/suggestions/image_encoder.h" | 18 #include "components/suggestions/image_encoder.h" |
19 #include "components/suggestions/proto/suggestions.pb.h" | 19 #include "components/suggestions/proto/suggestions.pb.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "ui/gfx/image/image_skia.h" | 22 #include "ui/gfx/image/image_skia.h" |
23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 image_manager_->GetImageForURL(GURL(kTestUrl1), | 210 image_manager_->GetImageForURL(GURL(kTestUrl1), |
211 base::Bind(&ImageManagerTest::OnImageAvailable, | 211 base::Bind(&ImageManagerTest::OnImageAvailable, |
212 base::Unretained(this), &run_loop)); | 212 base::Unretained(this), &run_loop)); |
213 run_loop.Run(); | 213 run_loop.Run(); |
214 | 214 |
215 EXPECT_EQ(0, num_callback_null_called_); | 215 EXPECT_EQ(0, num_callback_null_called_); |
216 EXPECT_EQ(1, num_callback_valid_called_); | 216 EXPECT_EQ(1, num_callback_valid_called_); |
217 } | 217 } |
218 | 218 |
219 } // namespace suggestions | 219 } // namespace suggestions |
OLD | NEW |