Chromium Code Reviews| 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 "ash/screen_ash.h" | 5 #include "ash/screen_ash.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 EXPECT_EQ("0,0 500x452", | 64 EXPECT_EQ("0,0 500x452", |
| 65 ScreenAsh::GetDisplayWorkAreaBoundsInParent( | 65 ScreenAsh::GetDisplayWorkAreaBoundsInParent( |
| 66 secondary->GetNativeView()).ToString()); | 66 secondary->GetNativeView()).ToString()); |
| 67 } else { | 67 } else { |
| 68 EXPECT_EQ("0,0 500x500", | 68 EXPECT_EQ("0,0 500x500", |
| 69 ScreenAsh::GetDisplayWorkAreaBoundsInParent( | 69 ScreenAsh::GetDisplayWorkAreaBoundsInParent( |
| 70 secondary->GetNativeView()).ToString()); | 70 secondary->GetNativeView()).ToString()); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Test verifies a stable handling of secondary screen widget changes | |
| 75 // (crbug.com/226132). | |
| 76 TEST_F(ScreenAshTest, StabilityTest) { | |
| 77 UpdateDisplay("600x600,500x500"); | |
| 78 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds( | |
| 79 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100)); | |
|
oshima
2013/04/04 08:03:22
check if the secondary is indeed on 2nd display.
E
| |
| 80 secondary->Show(); | |
| 81 secondary->Maximize(); | |
| 82 secondary->Show(); | |
| 83 secondary->SetFullscreen(true); | |
| 84 secondary->Hide(); | |
| 85 secondary->Close(); | |
| 86 } | |
| 87 | |
| 74 TEST_F(ScreenAshTest, ConvertRect) { | 88 TEST_F(ScreenAshTest, ConvertRect) { |
| 75 UpdateDisplay("600x600,500x500"); | 89 UpdateDisplay("600x600,500x500"); |
| 76 | 90 |
| 77 views::Widget* primary = views::Widget::CreateWindowWithContextAndBounds( | 91 views::Widget* primary = views::Widget::CreateWindowWithContextAndBounds( |
| 78 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100)); | 92 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100)); |
| 79 primary->Show(); | 93 primary->Show(); |
| 80 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds( | 94 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds( |
| 81 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100)); | 95 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100)); |
| 82 secondary->Show(); | 96 secondary->Show(); |
| 83 | 97 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 95 ScreenAsh::ConvertRectToScreen( | 109 ScreenAsh::ConvertRectToScreen( |
| 96 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString()); | 110 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString()); |
| 97 EXPECT_EQ( | 111 EXPECT_EQ( |
| 98 "650,50 100x100", | 112 "650,50 100x100", |
| 99 ScreenAsh::ConvertRectToScreen( | 113 ScreenAsh::ConvertRectToScreen( |
| 100 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString()); | 114 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString()); |
| 101 } | 115 } |
| 102 | 116 |
| 103 } // namespace test | 117 } // namespace test |
| 104 } // namespace ash | 118 } // namespace ash |
| OLD | NEW |