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

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

Issue 299713007: [Suggestions] Adding a Thumbnail Manager for the Suggestions Service (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean Created 6 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <string>
6
7 #include "chrome/browser/search/suggestions/proto/suggestions.pb.h"
8 #include "chrome/browser/search/suggestions/thumbnail_manager.h"
9 #include "chrome/test/base/testing_profile.h"
10 #include "content/public/test/test_browser_thread_bundle.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "url/gurl.h"
13
14 namespace {
15
16 const char kTestUrl[] = "http://go.com/";
17 const char kTestThumbnailUrl[] = "http://thumb.com/anchor_download_test.png";
18
19 class ThumbnailManagerTest : public testing::Test {
20 protected:
21 content::TestBrowserThreadBundle thread_bundle_;
22 };
23
24 } // namespace.
huangs 2014/05/22 06:17:35 No period at end.
Mathieu 2014/05/22 15:45:51 Done.
25
26 namespace suggestions {
27
28 TEST_F(ThumbnailManagerTest, InitializeThumbnailMapTest) {
29 SuggestionsProfile suggestions_profile;
30 ChromeSuggestion* suggestion = suggestions_profile.add_suggestions();
31 suggestion->set_url(kTestUrl);
32 suggestion->set_thumbnail(kTestThumbnailUrl);
33
34 TestingProfile profile;
35 ThumbnailManager thumbnail_manager(&profile);
36 thumbnail_manager.InitializeThumbnailMap(suggestions_profile);
37
38 GURL output;
39 EXPECT_TRUE(thumbnail_manager.GetThumbnailURL(GURL(kTestUrl), &output));
40 EXPECT_EQ(GURL(kTestThumbnailUrl), output);
41
42 EXPECT_FALSE(thumbnail_manager.GetThumbnailURL(GURL("http://b.com"),
43 &output));
44 }
45
46 } // namespace suggestions.
huangs 2014/05/22 06:17:35 No period at end.
Mathieu 2014/05/22 15:45:51 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698