| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/status_icons/status_icon_menu_model.h" | 5 #include "chrome/browser/status_icons/status_icon_menu_model.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/theme/grit/chrome_unscaled_resources.h" | |
| 11 #include "chrome/browser/status_icons/status_icon.h" | 10 #include "chrome/browser/status_icons/status_icon.h" |
| 12 #include "chrome/browser/status_icons/status_tray.h" | 11 #include "chrome/browser/status_icons/status_tray.h" |
| 12 #include "grit/chrome_unscaled_resources.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "ui/base/accelerators/accelerator.h" | 14 #include "ui/base/accelerators/accelerator.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
| 17 | 17 |
| 18 using base::ASCIIToUTF16; | 18 using base::ASCIIToUTF16; |
| 19 | 19 |
| 20 class StatusIconMenuModelTest : public testing::Test, | 20 class StatusIconMenuModelTest : public testing::Test, |
| 21 public StatusIconMenuModel::Observer { | 21 public StatusIconMenuModel::Observer { |
| 22 public: | 22 public: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 // Ensure changes to one menu item does not affect the other menu item. | 112 // Ensure changes to one menu item does not affect the other menu item. |
| 113 EXPECT_FALSE(menu_model()->GetAcceleratorForCommandId(1, &accel_arg)); | 113 EXPECT_FALSE(menu_model()->GetAcceleratorForCommandId(1, &accel_arg)); |
| 114 EXPECT_EQ(base::string16(), menu_model()->GetLabelForCommandId(1)); | 114 EXPECT_EQ(base::string16(), menu_model()->GetLabelForCommandId(1)); |
| 115 EXPECT_EQ(base::string16(), menu_model()->GetSublabelForCommandId(0)); | 115 EXPECT_EQ(base::string16(), menu_model()->GetSublabelForCommandId(0)); |
| 116 EXPECT_FALSE(menu_model()->GetIconForCommandId(0, &image_arg)); | 116 EXPECT_FALSE(menu_model()->GetIconForCommandId(0, &image_arg)); |
| 117 | 117 |
| 118 // Menu state should have changed 8 times in this test. | 118 // Menu state should have changed 8 times in this test. |
| 119 EXPECT_EQ(8, changed_count()); | 119 EXPECT_EQ(8, changed_count()); |
| 120 } | 120 } |
| OLD | NEW |