| 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 "ash/frame/caption_buttons/alternate_frame_size_button.h" | 5 #include "ash/frame/caption_buttons/alternate_frame_size_button.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | |
| 8 #include "ash/frame/caption_buttons/frame_caption_button.h" | 7 #include "ash/frame/caption_buttons/frame_caption_button.h" |
| 9 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 10 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 11 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| 12 #include "ash/wm/window_state.h" | 11 #include "ash/wm/window_state.h" |
| 13 #include "base/command_line.h" | |
| 14 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 15 #include "grit/ash_resources.h" | 13 #include "grit/ash_resources.h" |
| 16 #include "ui/aura/test/event_generator.h" | 14 #include "ui/aura/test/event_generator.h" |
| 17 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 19 #include "ui/events/gestures/gesture_configuration.h" | 17 #include "ui/events/gestures/gesture_configuration.h" |
| 20 #include "ui/gfx/display.h" | 18 #include "ui/gfx/display.h" |
| 21 #include "ui/gfx/screen.h" | 19 #include "ui/gfx/screen.h" |
| 22 #include "ui/views/widget/widget.h" | 20 #include "ui/views/widget/widget.h" |
| 23 #include "ui/views/widget/widget_delegate.h" | 21 #include "ui/views/widget/widget_delegate.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 params.bounds = gfx::Rect(10, 10, 100, 100); | 118 params.bounds = gfx::Rect(10, 10, 100, 100); |
| 121 widget->Init(params); | 119 widget->Init(params); |
| 122 widget->Show(); | 120 widget->Show(); |
| 123 return widget; | 121 return widget; |
| 124 } | 122 } |
| 125 | 123 |
| 126 // AshTestBase overrides: | 124 // AshTestBase overrides: |
| 127 virtual void SetUp() OVERRIDE { | 125 virtual void SetUp() OVERRIDE { |
| 128 AshTestBase::SetUp(); | 126 AshTestBase::SetUp(); |
| 129 | 127 |
| 130 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
| 131 command_line->AppendSwitch( | |
| 132 switches::kAshEnableAlternateFrameCaptionButtonStyle); | |
| 133 | |
| 134 TestWidgetDelegate* delegate = new TestWidgetDelegate(); | 128 TestWidgetDelegate* delegate = new TestWidgetDelegate(); |
| 135 window_state_ = ash::wm::GetWindowState( | 129 window_state_ = ash::wm::GetWindowState( |
| 136 CreateWidget(delegate)->GetNativeWindow()); | 130 CreateWidget(delegate)->GetNativeWindow()); |
| 137 | 131 |
| 138 FrameCaptionButtonContainerView::TestApi test( | 132 FrameCaptionButtonContainerView::TestApi test( |
| 139 delegate->caption_button_container()); | 133 delegate->caption_button_container()); |
| 140 | 134 |
| 141 minimize_button_ = test.minimize_button(); | 135 minimize_button_ = test.minimize_button(); |
| 142 size_button_ = test.size_button(); | 136 size_button_ = test.size_button(); |
| 143 static_cast<AlternateFrameSizeButton*>( | 137 static_cast<AlternateFrameSizeButton*>( |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 463 |
| 470 // None of the buttons should stay pressed and the buttons should have their | 464 // None of the buttons should stay pressed and the buttons should have their |
| 471 // regular icons. | 465 // regular icons. |
| 472 EXPECT_TRUE(AllButtonsInNormalState()); | 466 EXPECT_TRUE(AllButtonsInNormalState()); |
| 473 EXPECT_EQ(CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon()); | 467 EXPECT_EQ(CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon()); |
| 474 EXPECT_EQ(CAPTION_BUTTON_ICON_CLOSE, close_button()->icon()); | 468 EXPECT_EQ(CAPTION_BUTTON_ICON_CLOSE, close_button()->icon()); |
| 475 } | 469 } |
| 476 | 470 |
| 477 } // namespace test | 471 } // namespace test |
| 478 } // namespace ash | 472 } // namespace ash |
| OLD | NEW |