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

Side by Side Diff: chrome/browser/history/expire_history_backend_unittest.cc

Issue 10378009: Get rid of Image::Image(SkBitmap*) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: k Created 8 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
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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 url_ids[1] = main_db_->AddURL(url_row2); 223 url_ids[1] = main_db_->AddURL(url_row2);
224 thumb_db_->AddIconMapping(url_row2.url(), favicon1); 224 thumb_db_->AddIconMapping(url_row2.url(), favicon1);
225 225
226 URLRow url_row3(GURL("http://www.google.com/3")); 226 URLRow url_row3(GURL("http://www.google.com/3"));
227 url_row3.set_last_visit(visit_times[3]); 227 url_row3.set_last_visit(visit_times[3]);
228 url_row3.set_visit_count(1); 228 url_row3.set_visit_count(1);
229 url_ids[2] = main_db_->AddURL(url_row3); 229 url_ids[2] = main_db_->AddURL(url_row3);
230 thumb_db_->AddIconMapping(url_row3.url(), favicon2); 230 thumb_db_->AddIconMapping(url_row3.url(), favicon2);
231 231
232 // Thumbnails for each URL. |thumbnail| takes ownership of decoded SkBitmap. 232 // Thumbnails for each URL. |thumbnail| takes ownership of decoded SkBitmap.
233 gfx::Image thumbnail( 233 scoped_ptr<SkBitmap> thumbnail_bitmap(
234 gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); 234 gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail)));
235 gfx::Image thumbnail(*thumbnail_bitmap);
235 ThumbnailScore score(0.25, true, true, Time::Now()); 236 ThumbnailScore score(0.25, true, true, Time::Now());
236 237
237 Time time; 238 Time time;
238 GURL gurl; 239 GURL gurl;
239 top_sites_->SetPageThumbnail(url_row1.url(), &thumbnail, score); 240 top_sites_->SetPageThumbnail(url_row1.url(), &thumbnail, score);
240 top_sites_->SetPageThumbnail(url_row2.url(), &thumbnail, score); 241 top_sites_->SetPageThumbnail(url_row2.url(), &thumbnail, score);
241 top_sites_->SetPageThumbnail(url_row3.url(), &thumbnail, score); 242 top_sites_->SetPageThumbnail(url_row3.url(), &thumbnail, score);
242 243
243 // Four visits. 244 // Four visits.
244 VisitRow visit_row1; 245 VisitRow visit_row1;
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 main_db_->GetVisitsForURL(url_id, &archived_visits); 956 main_db_->GetVisitsForURL(url_id, &archived_visits);
956 EXPECT_EQ(0U, archived_visits.size()); 957 EXPECT_EQ(0U, archived_visits.size());
957 } 958 }
958 959
959 // TODO(brettw) add some visits with no URL to make sure everything is updated 960 // TODO(brettw) add some visits with no URL to make sure everything is updated
960 // properly. Have the visits also refer to nonexistent FTS rows. 961 // properly. Have the visits also refer to nonexistent FTS rows.
961 // 962 //
962 // Maybe also refer to invalid favicons. 963 // Maybe also refer to invalid favicons.
963 964
964 } // namespace history 965 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.cc ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698