| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ash/system/status_area_widget.h" | 5 #include "ash/system/status_area_widget.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/system/ime_menu/ime_menu_tray.h" | 8 #include "ash/system/ime_menu/ime_menu_tray.h" |
| 9 #include "ash/system/overview/overview_button_tray.h" | 9 #include "ash/system/overview/overview_button_tray.h" |
| 10 #include "ash/system/palette/palette_tray.h" | 10 #include "ash/system/palette/palette_tray.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 public: | 62 public: |
| 63 StatusAreaWidgetPaletteTest() {} | 63 StatusAreaWidgetPaletteTest() {} |
| 64 ~StatusAreaWidgetPaletteTest() override {} | 64 ~StatusAreaWidgetPaletteTest() override {} |
| 65 | 65 |
| 66 // testing::Test: | 66 // testing::Test: |
| 67 void SetUp() override { | 67 void SetUp() override { |
| 68 // TODO(erg): The implementation of PaletteTray assumes it can talk directly | 68 // TODO(erg): The implementation of PaletteTray assumes it can talk directly |
| 69 // to ui::InputDeviceManager in a mus environment, which it can't. | 69 // to ui::InputDeviceManager in a mus environment, which it can't. |
| 70 if (aura::Env::GetInstance()->mode() != aura::Env::Mode::MUS) { | 70 if (aura::Env::GetInstance()->mode() != aura::Env::Mode::MUS) { |
| 71 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 71 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 72 cmd->AppendSwitch(switches::kAshForceEnablePalette); | 72 cmd->AppendSwitch(switches::kAshForceEnableStylusTools); |
| 73 // It's difficult to write a test that marks the primary display as | 73 // It's difficult to write a test that marks the primary display as |
| 74 // internal before the status area is constructed. Just force the palette | 74 // internal before the status area is constructed. Just force the palette |
| 75 // for all displays. | 75 // for all displays. |
| 76 cmd->AppendSwitch(switches::kAshEnablePaletteOnAllDisplays); | 76 cmd->AppendSwitch(switches::kAshEnablePaletteOnAllDisplays); |
| 77 } | 77 } |
| 78 AshTestBase::SetUp(); | 78 AshTestBase::SetUp(); |
| 79 } | 79 } |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 // Tests that the stylus palette tray is constructed. | 82 // Tests that the stylus palette tray is constructed. |
| 83 TEST_F(StatusAreaWidgetPaletteTest, Basics) { | 83 TEST_F(StatusAreaWidgetPaletteTest, Basics) { |
| 84 // TODO(erg): The implementation of PaletteTray assumes it can talk directly | 84 // TODO(erg): The implementation of PaletteTray assumes it can talk directly |
| 85 // to ui::InputDeviceManager in a mus environment, which it can't. | 85 // to ui::InputDeviceManager in a mus environment, which it can't. |
| 86 if (aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS) | 86 if (aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS) |
| 87 return; | 87 return; |
| 88 | 88 |
| 89 StatusAreaWidget* status = StatusAreaWidgetTestHelper::GetStatusAreaWidget(); | 89 StatusAreaWidget* status = StatusAreaWidgetTestHelper::GetStatusAreaWidget(); |
| 90 EXPECT_TRUE(status->palette_tray()); | 90 EXPECT_TRUE(status->palette_tray()); |
| 91 | 91 |
| 92 // Auto-hidden shelf would not be forced to be visible. | 92 // Auto-hidden shelf would not be forced to be visible. |
| 93 EXPECT_FALSE(status->ShouldShowShelf()); | 93 EXPECT_FALSE(status->ShouldShowShelf()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace ash | 96 } // namespace ash |
| OLD | NEW |