| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 | 1000 |
| 1001 // Start with something invalid to ensure it changes. | 1001 // Start with something invalid to ensure it changes. |
| 1002 ui::WindowShowState show_state = ui::SHOW_STATE_END; | 1002 ui::WindowShowState show_state = ui::SHOW_STATE_END; |
| 1003 gfx::Rect restored_bounds; | 1003 gfx::Rect restored_bounds; |
| 1004 | 1004 |
| 1005 internal::NativeWidgetPrivate* native_widget = | 1005 internal::NativeWidgetPrivate* native_widget = |
| 1006 widget->native_widget_private(); | 1006 widget->native_widget_private(); |
| 1007 | 1007 |
| 1008 native_widget->GetWindowPlacement(&restored_bounds, &show_state); | 1008 native_widget->GetWindowPlacement(&restored_bounds, &show_state); |
| 1009 EXPECT_EQ(expected_bounds, restored_bounds); | 1009 EXPECT_EQ(expected_bounds, restored_bounds); |
| 1010 #if defined(OS_LINUX) | |
| 1011 // Non-desktop/Ash widgets start off in "default" until a Restore(). | |
| 1012 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, show_state); | |
| 1013 widget->Restore(); | |
| 1014 native_widget->GetWindowPlacement(&restored_bounds, &show_state); | |
| 1015 #endif | |
| 1016 EXPECT_EQ(ui::SHOW_STATE_NORMAL, show_state); | 1010 EXPECT_EQ(ui::SHOW_STATE_NORMAL, show_state); |
| 1017 | 1011 |
| 1018 widget->Minimize(); | 1012 widget->Minimize(); |
| 1019 native_widget->GetWindowPlacement(&restored_bounds, &show_state); | 1013 native_widget->GetWindowPlacement(&restored_bounds, &show_state); |
| 1020 EXPECT_EQ(ui::SHOW_STATE_MINIMIZED, show_state); | 1014 EXPECT_EQ(ui::SHOW_STATE_MINIMIZED, show_state); |
| 1021 EXPECT_EQ(expected_bounds, restored_bounds); | 1015 EXPECT_EQ(expected_bounds, restored_bounds); |
| 1022 | 1016 |
| 1023 widget->Restore(); | 1017 widget->Restore(); |
| 1024 native_widget->GetWindowPlacement(&restored_bounds, &show_state); | 1018 native_widget->GetWindowPlacement(&restored_bounds, &show_state); |
| 1025 EXPECT_EQ(ui::SHOW_STATE_NORMAL, show_state); | 1019 EXPECT_EQ(ui::SHOW_STATE_NORMAL, show_state); |
| (...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3253 EXPECT_FALSE(widget->IsAlwaysOnTop()); | 3247 EXPECT_FALSE(widget->IsAlwaysOnTop()); |
| 3254 widget->SetAlwaysOnTop(true); | 3248 widget->SetAlwaysOnTop(true); |
| 3255 EXPECT_TRUE(widget->IsAlwaysOnTop()); | 3249 EXPECT_TRUE(widget->IsAlwaysOnTop()); |
| 3256 widget->SetAlwaysOnTop(false); | 3250 widget->SetAlwaysOnTop(false); |
| 3257 EXPECT_FALSE(widget->IsAlwaysOnTop()); | 3251 EXPECT_FALSE(widget->IsAlwaysOnTop()); |
| 3258 widget->CloseNow(); | 3252 widget->CloseNow(); |
| 3259 } | 3253 } |
| 3260 | 3254 |
| 3261 } // namespace test | 3255 } // namespace test |
| 3262 } // namespace views | 3256 } // namespace views |
| OLD | NEW |