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 "base/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/status_icons/status_icon.h" | 7 #include "chrome/browser/status_icons/status_icon.h" |
7 #include "chrome/browser/status_icons/status_tray.h" | 8 #include "chrome/browser/status_icons/status_tray.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 | 11 |
11 using testing::Return; | 12 using testing::Return; |
12 | 13 |
13 class MockStatusIcon : public StatusIcon { | 14 class MockStatusIcon : public StatusIcon { |
14 virtual void SetImage(const SkBitmap& image) {} | 15 virtual void SetImage(const SkBitmap& image) {} |
15 virtual void SetPressedImage(const SkBitmap& image) {} | 16 virtual void SetPressedImage(const SkBitmap& image) {} |
(...skipping 29 matching lines...) Expand all Loading... |
45 EXPECT_CALL(tray, CreateStatusIcon()).Times(2) | 46 EXPECT_CALL(tray, CreateStatusIcon()).Times(2) |
46 .WillOnce(Return(new MockStatusIcon())) | 47 .WillOnce(Return(new MockStatusIcon())) |
47 .WillOnce(Return(new MockStatusIcon())); | 48 .WillOnce(Return(new MockStatusIcon())); |
48 StatusIcon* icon = tray.GetStatusIcon(id); | 49 StatusIcon* icon = tray.GetStatusIcon(id); |
49 EXPECT_EQ(icon, tray.GetStatusIcon(id)); | 50 EXPECT_EQ(icon, tray.GetStatusIcon(id)); |
50 | 51 |
51 // If we remove the icon, then we should create a new one the next time in. | 52 // If we remove the icon, then we should create a new one the next time in. |
52 tray.RemoveStatusIcon(id); | 53 tray.RemoveStatusIcon(id); |
53 tray.GetStatusIcon(id); | 54 tray.GetStatusIcon(id); |
54 } | 55 } |
OLD | NEW |