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 <string> | 5 #include <string> |
6 | 6 |
7 #include "chrome/browser/image_holder.h" | 7 #include "chrome/browser/image_holder.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 const char kIconUrl1[] = "http://www.google.com/icon1.jpg"; | 12 const char kIconUrl1[] = "http://www.google.com/icon1.jpg"; |
13 const char kIconUrl2[] = "http://www.google.com/icon2.jpg"; | 13 const char kIconUrl2[] = "http://www.google.com/icon2.jpg"; |
14 | 14 |
15 class TestDelegate : public chrome::ImageHolderDelegate { | 15 class TestDelegate : public chrome::ImageHolderDelegate { |
16 public: | 16 public: |
17 TestDelegate() : on_fetch_complete_called_(false) {} | 17 TestDelegate() : on_fetch_complete_called_(false) {} |
18 virtual void OnFetchComplete() OVERRIDE { | 18 virtual void OnFetchComplete() override { |
19 on_fetch_complete_called_ = true; | 19 on_fetch_complete_called_ = true; |
20 } | 20 } |
21 bool on_fetch_complete_called_; | 21 bool on_fetch_complete_called_; |
22 }; | 22 }; |
23 | 23 |
24 } // namespace. | 24 } // namespace. |
25 | 25 |
26 namespace chrome { | 26 namespace chrome { |
27 | 27 |
28 typedef testing::Test ImageHolderTest; | 28 typedef testing::Test ImageHolderTest; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 image_holder2.OnFetchComplete(GURL(kIconUrl2), &bitmap); | 93 image_holder2.OnFetchComplete(GURL(kIconUrl2), &bitmap); |
94 image_holder3.OnFetchComplete(GURL(kIconUrl2), &bitmap); | 94 image_holder3.OnFetchComplete(GURL(kIconUrl2), &bitmap); |
95 image_holder4.OnFetchComplete(GURL(kIconUrl2), &bitmap); | 95 image_holder4.OnFetchComplete(GURL(kIconUrl2), &bitmap); |
96 EXPECT_TRUE(image_holder1.IsFetchingDone()); | 96 EXPECT_TRUE(image_holder1.IsFetchingDone()); |
97 EXPECT_TRUE(image_holder2.IsFetchingDone()); | 97 EXPECT_TRUE(image_holder2.IsFetchingDone()); |
98 EXPECT_TRUE(image_holder3.IsFetchingDone()); | 98 EXPECT_TRUE(image_holder3.IsFetchingDone()); |
99 EXPECT_TRUE(image_holder4.IsFetchingDone()); | 99 EXPECT_TRUE(image_holder4.IsFetchingDone()); |
100 } | 100 } |
101 | 101 |
102 } // namespace chrome. | 102 } // namespace chrome. |
OLD | NEW |