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

Side by Side Diff: components/history/core/browser/history_backend_unittest.cc

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase Created 3 years, 8 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
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 "components/history/core/browser/history_backend.h" 5 #include "components/history/core/browser/history_backend.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 *bitmap_data->front() == expected_data; 478 *bitmap_data->front() == expected_data;
479 } 479 }
480 480
481 // Returns true if |bitmap_data| is of |color|. 481 // Returns true if |bitmap_data| is of |color|.
482 bool BitmapColorEqual(SkColor expected_color, 482 bool BitmapColorEqual(SkColor expected_color,
483 scoped_refptr<base::RefCountedMemory> bitmap_data) { 483 scoped_refptr<base::RefCountedMemory> bitmap_data) {
484 SkBitmap bitmap; 484 SkBitmap bitmap;
485 if (!gfx::PNGCodec::Decode(bitmap_data->front(), bitmap_data->size(), 485 if (!gfx::PNGCodec::Decode(bitmap_data->front(), bitmap_data->size(),
486 &bitmap)) 486 &bitmap))
487 return false; 487 return false;
488 SkAutoLockPixels bitmap_lock(bitmap);
489 return expected_color == bitmap.getColor(0, 0); 488 return expected_color == bitmap.getColor(0, 0);
490 } 489 }
491 490
492 private: 491 private:
493 DISALLOW_COPY_AND_ASSIGN(HistoryBackendTest); 492 DISALLOW_COPY_AND_ASSIGN(HistoryBackendTest);
494 }; 493 };
495 494
496 class InMemoryHistoryBackendTest : public HistoryBackendTestBase { 495 class InMemoryHistoryBackendTest : public HistoryBackendTestBase {
497 public: 496 public:
498 InMemoryHistoryBackendTest() {} 497 InMemoryHistoryBackendTest() {}
(...skipping 3427 matching lines...) Expand 10 before | Expand all | Expand 10 after
3926 backend_->QueryMostVisitedURLs(100, 100, &most_visited); 3925 backend_->QueryMostVisitedURLs(100, 100, &most_visited);
3927 3926
3928 const base::string16 kSomeTitle; // Ignored by equality operator. 3927 const base::string16 kSomeTitle; // Ignored by equality operator.
3929 EXPECT_THAT( 3928 EXPECT_THAT(
3930 most_visited, 3929 most_visited,
3931 ElementsAre(MostVisitedURL(GURL("http://example1.com"), kSomeTitle), 3930 ElementsAre(MostVisitedURL(GURL("http://example1.com"), kSomeTitle),
3932 MostVisitedURL(GURL("http://example5.com"), kSomeTitle))); 3931 MostVisitedURL(GURL("http://example5.com"), kSomeTitle)));
3933 } 3932 }
3934 3933
3935 } // namespace history 3934 } // namespace history
OLDNEW
« no previous file with comments | « components/favicon_base/select_favicon_frames_unittest.cc ('k') | components/suggestions/image_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698