OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/resource_bundle.h" | |
6 #include "base/string_util.h" | 5 #include "base/string_util.h" |
7 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
9 #include "chrome/browser/ui/cocoa/status_icons/status_icon_mac.h" | 8 #include "chrome/browser/ui/cocoa/status_icons/status_icon_mac.h" |
10 #include "grit/browser_resources.h" | 9 #include "grit/browser_resources.h" |
11 #include "grit/theme_resources.h" | 10 #include "grit/theme_resources.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "ui/base/resource/resource_bundle.h" |
14 | 14 |
15 class SkBitmap; | 15 class SkBitmap; |
16 | 16 |
17 class StatusIconMacTest : public CocoaTest { | 17 class StatusIconMacTest : public CocoaTest { |
18 }; | 18 }; |
19 | 19 |
20 TEST_F(StatusIconMacTest, Create) { | 20 TEST_F(StatusIconMacTest, Create) { |
21 // Create an icon, set the tool tip, then shut it down (checks for leaks). | 21 // Create an icon, set the tool tip, then shut it down (checks for leaks). |
22 scoped_ptr<StatusIcon> icon(new StatusIconMac()); | 22 scoped_ptr<StatusIcon> icon(new StatusIconMac()); |
23 SkBitmap* bitmap = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 23 SkBitmap* bitmap = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
24 IDR_STATUS_TRAY_ICON); | 24 IDR_STATUS_TRAY_ICON); |
25 icon->SetImage(*bitmap); | 25 icon->SetImage(*bitmap); |
26 SkBitmap* pressed = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 26 SkBitmap* pressed = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
27 IDR_STATUS_TRAY_ICON_PRESSED); | 27 IDR_STATUS_TRAY_ICON_PRESSED); |
28 icon->SetPressedImage(*pressed); | 28 icon->SetPressedImage(*pressed); |
29 icon->SetToolTip(ASCIIToUTF16("tool tip")); | 29 icon->SetToolTip(ASCIIToUTF16("tool tip")); |
30 } | 30 } |
OLD | NEW |