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

Side by Side Diff: chrome/browser/search/suggestions/thumbnail_manager_unittest.cc

Issue 392983007: [Suggestions] Make ThumbnailManager implement ImageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 5 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 | Annotate | Revision Log
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/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
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, InitializeTest) {
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->Initialize(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
OLDNEW
« no previous file with comments | « chrome/browser/search/suggestions/thumbnail_manager_browsertest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698