| 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/wm/toplevel_window_event_handler.h" | 5 #include "ash/wm/toplevel_window_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 EXPECT_EQ( | 350 EXPECT_EQ( |
| 351 gfx::Size(100, work_area.height() - target->bounds().y()).ToString(), | 351 gfx::Size(100, work_area.height() - target->bounds().y()).ToString(), |
| 352 target->bounds().size().ToString()); | 352 target->bounds().size().ToString()); |
| 353 } | 353 } |
| 354 | 354 |
| 355 TEST_F(ToplevelWindowEventHandlerTest, DontDragIfModalChild) { | 355 TEST_F(ToplevelWindowEventHandlerTest, DontDragIfModalChild) { |
| 356 scoped_ptr<aura::Window> w1(CreateWindow(HTCAPTION)); | 356 scoped_ptr<aura::Window> w1(CreateWindow(HTCAPTION)); |
| 357 scoped_ptr<aura::Window> w2(CreateWindow(HTCAPTION)); | 357 scoped_ptr<aura::Window> w2(CreateWindow(HTCAPTION)); |
| 358 w2->SetBounds(gfx::Rect(100, 0, 100, 100)); | 358 w2->SetBounds(gfx::Rect(100, 0, 100, 100)); |
| 359 w2->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); | 359 w2->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); |
| 360 views::corewm::AddTransientChild(w1.get(), w2.get()); | 360 ::wm::AddTransientChild(w1.get(), w2.get()); |
| 361 gfx::Size size = w1->bounds().size(); | 361 gfx::Size size = w1->bounds().size(); |
| 362 | 362 |
| 363 // Attempt to drag w1, position and size should not change because w1 has a | 363 // Attempt to drag w1, position and size should not change because w1 has a |
| 364 // modal child. | 364 // modal child. |
| 365 DragFromCenterBy(w1.get(), 100, 100); | 365 DragFromCenterBy(w1.get(), 100, 100); |
| 366 EXPECT_EQ("0,0", w1->bounds().origin().ToString()); | 366 EXPECT_EQ("0,0", w1->bounds().origin().ToString()); |
| 367 EXPECT_EQ(size.ToString(), w1->bounds().size().ToString()); | 367 EXPECT_EQ(size.ToString(), w1->bounds().size().ToString()); |
| 368 | 368 |
| 369 TouchDragFromCenterBy(w1.get(), 100, 100); | 369 TouchDragFromCenterBy(w1.get(), 100, 100); |
| 370 EXPECT_EQ("0,0", w1->bounds().origin().ToString()); | 370 EXPECT_EQ("0,0", w1->bounds().origin().ToString()); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 | 703 |
| 704 generator.ReleaseLeftButton(); | 704 generator.ReleaseLeftButton(); |
| 705 EXPECT_EQ("10,11 100x100", window1->bounds().ToString()); | 705 EXPECT_EQ("10,11 100x100", window1->bounds().ToString()); |
| 706 } | 706 } |
| 707 | 707 |
| 708 // Showing the resize shadows when the mouse is over the window edges is tested | 708 // Showing the resize shadows when the mouse is over the window edges is tested |
| 709 // in resize_shadow_and_cursor_test.cc | 709 // in resize_shadow_and_cursor_test.cc |
| 710 | 710 |
| 711 } // namespace test | 711 } // namespace test |
| 712 } // namespace ash | 712 } // namespace ash |
| OLD | NEW |