| 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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/search/suggestions/proto/suggestions.pb.h" | 8 #include "chrome/browser/search/suggestions/proto/suggestions.pb.h" |
| 9 #include "chrome/browser/search/suggestions/thumbnail_manager.h" | 9 #include "chrome/browser/search/suggestions/thumbnail_manager.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 content::TestBrowserThreadBundle thread_bundle_; | 38 content::TestBrowserThreadBundle thread_bundle_; |
| 39 EntryMap db_model_; | 39 EntryMap db_model_; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 namespace suggestions { | 44 namespace suggestions { |
| 45 | 45 |
| 46 TEST_F(ThumbnailManagerTest, InitializeThumbnailMapTest) { | 46 TEST_F(ThumbnailManagerTest, InitializeImageMapTest) { |
| 47 SuggestionsProfile suggestions_profile; | 47 SuggestionsProfile suggestions_profile; |
| 48 ChromeSuggestion* suggestion = suggestions_profile.add_suggestions(); | 48 ChromeSuggestion* suggestion = suggestions_profile.add_suggestions(); |
| 49 suggestion->set_url(kTestUrl); | 49 suggestion->set_url(kTestUrl); |
| 50 suggestion->set_thumbnail(kTestThumbnailUrl); | 50 suggestion->set_thumbnail(kTestThumbnailUrl); |
| 51 | 51 |
| 52 TestingProfile profile; | 52 TestingProfile profile; |
| 53 scoped_ptr<ThumbnailManager> thumbnail_manager( | 53 scoped_ptr<ThumbnailManager> thumbnail_manager( |
| 54 CreateThumbnailManager(&profile)); | 54 CreateThumbnailManager(&profile)); |
| 55 thumbnail_manager->InitializeThumbnailMap(suggestions_profile); | 55 thumbnail_manager->InitializeImageMap(suggestions_profile); |
| 56 | 56 |
| 57 GURL output; | 57 GURL output; |
| 58 EXPECT_TRUE(thumbnail_manager->GetThumbnailURL(GURL(kTestUrl), &output)); | 58 EXPECT_TRUE(thumbnail_manager->GetThumbnailURL(GURL(kTestUrl), &output)); |
| 59 EXPECT_EQ(GURL(kTestThumbnailUrl), output); | 59 EXPECT_EQ(GURL(kTestThumbnailUrl), output); |
| 60 | 60 |
| 61 EXPECT_FALSE( | 61 EXPECT_FALSE( |
| 62 thumbnail_manager->GetThumbnailURL(GURL("http://b.com"), &output)); | 62 thumbnail_manager->GetThumbnailURL(GURL("http://b.com"), &output)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace suggestions | 65 } // namespace suggestions |
| OLD | NEW |