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

Side by Side Diff: chrome/browser/thumbnails/thumbnail_service_unittest.cc

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/thumbnails/thumbnail_service_impl.h" 5 #include "chrome/browser/thumbnails/thumbnail_service_impl.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "chrome/test/base/testing_profile.h" 8 #include "chrome/test/base/testing_profile.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 scoped_refptr<MockTopSites> mock_top_sites_; 69 scoped_refptr<MockTopSites> mock_top_sites_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(MockProfile); 71 DISALLOW_COPY_AND_ASSIGN(MockProfile);
72 }; 72 };
73 73
74 TEST_F(ThumbnailServiceTest, ShouldUpdateThumbnail) { 74 TEST_F(ThumbnailServiceTest, ShouldUpdateThumbnail) {
75 const GURL kGoodURL("http://www.google.com/"); 75 const GURL kGoodURL("http://www.google.com/");
76 const GURL kBadURL("chrome://newtab"); 76 const GURL kBadURL("chrome://newtab");
77 77
78 // Set up the mock profile along with mock top sites. 78 // Set up the mock profile along with mock top sites.
79 ScopedTempDir temp_dir; 79 base::ScopedTempDir temp_dir;
80 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 80 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
81 MockProfile profile; 81 MockProfile profile;
82 82
83 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service( 83 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service(
84 new thumbnails::ThumbnailServiceImpl(&profile)); 84 new thumbnails::ThumbnailServiceImpl(&profile));
85 85
86 // Should be false because it's a bad URL. 86 // Should be false because it's a bad URL.
87 EXPECT_FALSE(thumbnail_service->ShouldAcquirePageThumbnail(kBadURL)); 87 EXPECT_FALSE(thumbnail_service->ShouldAcquirePageThumbnail(kBadURL));
88 88
89 // Should be true, as it's a good URL. 89 // Should be true, as it's a good URL.
(...skipping 22 matching lines...) Expand all
112 good_score.at_top = true; 112 good_score.at_top = true;
113 good_score.good_clipping = true; 113 good_score.good_clipping = true;
114 good_score.boring_score = 0.0; 114 good_score.boring_score = 0.0;
115 good_score.load_completed = true; 115 good_score.load_completed = true;
116 profile.AddKnownURL(kGoodURL, good_score); 116 profile.AddKnownURL(kGoodURL, good_score);
117 117
118 // Should be false, as the existing thumbnail is good enough (i.e. don't 118 // Should be false, as the existing thumbnail is good enough (i.e. don't
119 // need to replace the existing thumbnail which is new and good). 119 // need to replace the existing thumbnail which is new and good).
120 EXPECT_FALSE(thumbnail_service->ShouldAcquirePageThumbnail(kGoodURL)); 120 EXPECT_FALSE(thumbnail_service->ShouldAcquirePageThumbnail(kGoodURL));
121 } 121 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/browser_theme_pack_unittest.cc ('k') | chrome/browser/ui/bookmarks/bookmark_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698