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

Side by Side Diff: chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm

Issue 271653003: Scrub deprecated Skia APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 // Make sure the item was modified properly. 338 // Make sure the item was modified properly.
339 EXPECT_TRUE(item.icon_requested); 339 EXPECT_TRUE(item.icon_requested);
340 EXPECT_NE(base::CancelableTaskTracker::kBadTaskId, item.icon_task_id); 340 EXPECT_NE(base::CancelableTaskTracker::kBadTaskId, item.icon_task_id);
341 } 341 }
342 342
343 TEST_F(HistoryMenuBridgeTest, GotFaviconData) { 343 TEST_F(HistoryMenuBridgeTest, GotFaviconData) {
344 // Create a dummy bitmap. 344 // Create a dummy bitmap.
345 SkBitmap bitmap; 345 SkBitmap bitmap;
346 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 25, 25); 346 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 25, 25);
347 bitmap.allocPixels(); 347 bitmap.allocPixels();
348 bitmap.eraseRGB(255, 0, 0); 348 bitmap.eraseARGB(255, 255, 0, 0);
349 349
350 // Set up the HistoryItem. 350 // Set up the HistoryItem.
351 HistoryMenuBridge::HistoryItem item; 351 HistoryMenuBridge::HistoryItem item;
352 item.menu_item.reset([[NSMenuItem alloc] init]); 352 item.menu_item.reset([[NSMenuItem alloc] init]);
353 GetFaviconForHistoryItem(&item); 353 GetFaviconForHistoryItem(&item);
354 354
355 // Pretend to be called back. 355 // Pretend to be called back.
356 favicon_base::FaviconImageResult image_result; 356 favicon_base::FaviconImageResult image_result;
357 image_result.image = gfx::Image::CreateFrom1xBitmap(bitmap); 357 image_result.image = gfx::Image::CreateFrom1xBitmap(bitmap);
358 GotFaviconData(&item, image_result); 358 GotFaviconData(&item, image_result);
359 359
360 // Make sure the callback works. 360 // Make sure the callback works.
361 EXPECT_FALSE(item.icon_requested); 361 EXPECT_FALSE(item.icon_requested);
362 EXPECT_TRUE(item.icon.get()); 362 EXPECT_TRUE(item.icon.get());
363 EXPECT_TRUE([item.menu_item image]); 363 EXPECT_TRUE([item.menu_item image]);
364 } 364 }
365 365
366 } // namespace 366 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698