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

Side by Side Diff: ui/message_center/views/notification_view_unittest.cc

Issue 361643002: setConfig is deprecated, use setInfo or allocPixels instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't call allocPixels+rowbytes yet (skia bug) Created 6 years, 5 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
« no previous file with comments | « ui/gfx/skbitmap_operations_unittest.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "ui/message_center/views/notification_view.h" 5 #include "ui/message_center/views/notification_view.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 virtual void ClickOnNotificationButton(const std::string& notification_id, 47 virtual void ClickOnNotificationButton(const std::string& notification_id,
48 int button_index) OVERRIDE; 48 int button_index) OVERRIDE;
49 49
50 protected: 50 protected:
51 const gfx::Image CreateTestImage(int width, int height) { 51 const gfx::Image CreateTestImage(int width, int height) {
52 return gfx::Image::CreateFrom1xBitmap(CreateBitmap(width, height)); 52 return gfx::Image::CreateFrom1xBitmap(CreateBitmap(width, height));
53 } 53 }
54 54
55 const SkBitmap CreateBitmap(int width, int height) { 55 const SkBitmap CreateBitmap(int width, int height) {
56 SkBitmap bitmap; 56 SkBitmap bitmap;
57 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); 57 bitmap.allocN32Pixels(width, height);
58 bitmap.allocPixels();
59 bitmap.eraseRGB(0, 255, 0); 58 bitmap.eraseRGB(0, 255, 0);
60 return bitmap; 59 return bitmap;
61 } 60 }
62 61
63 std::vector<ButtonInfo> CreateButtons(int number) { 62 std::vector<ButtonInfo> CreateButtons(int number) {
64 ButtonInfo info(base::ASCIIToUTF16("Test button title.")); 63 ButtonInfo info(base::ASCIIToUTF16("Test button title."));
65 info.icon = CreateTestImage(4, 4); 64 info.icon = CreateTestImage(4, 4);
66 return std::vector<ButtonInfo>(number, info); 65 return std::vector<ButtonInfo>(number, info);
67 } 66 }
68 67
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 313
315 // Double-check that vertical order is correct. 314 // Double-check that vertical order is correct.
316 CheckVerticalOrderInNotification(); 315 CheckVerticalOrderInNotification();
317 316
318 // Tests that views remain in that order even after an update. 317 // Tests that views remain in that order even after an update.
319 UpdateNotificationViews(); 318 UpdateNotificationViews();
320 CheckVerticalOrderInNotification(); 319 CheckVerticalOrderInNotification();
321 } 320 }
322 321
323 } // namespace message_center 322 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/gfx/skbitmap_operations_unittest.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698