Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/aura/wm_window_aura.h" | 5 #include "ash/aura/wm_window_aura.h" |
| 6 #include "ash/common/shell_window_ids.h" | 6 #include "ash/common/shell_window_ids.h" |
| 7 #include "ash/common/wm/window_state.h" | 7 #include "ash/common/wm/window_state.h" |
| 8 #include "ash/common/wm/wm_event.h" | 8 #include "ash/common/wm/wm_event.h" |
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 10 #include "ash/wm/window_state_aura.h" | 10 #include "ash/wm/window_state_aura.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 | 36 |
| 37 uint32_t ConfigureFullscreen(uint32_t serial, | 37 uint32_t ConfigureFullscreen(uint32_t serial, |
| 38 const gfx::Size& size, | 38 const gfx::Size& size, |
| 39 ash::wm::WindowStateType state_type, | 39 ash::wm::WindowStateType state_type, |
| 40 bool resizing, | 40 bool resizing, |
| 41 bool activated) { | 41 bool activated) { |
| 42 EXPECT_EQ(ash::wm::WINDOW_STATE_TYPE_FULLSCREEN, state_type); | 42 EXPECT_EQ(ash::wm::WINDOW_STATE_TYPE_FULLSCREEN, state_type); |
| 43 return serial; | 43 return serial; |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | |
| 47 | |
| 46 TEST_F(ShellSurfaceTest, AcknowledgeConfigure) { | 48 TEST_F(ShellSurfaceTest, AcknowledgeConfigure) { |
| 47 gfx::Size buffer_size(32, 32); | 49 gfx::Size buffer_size(32, 32); |
| 48 std::unique_ptr<Buffer> buffer( | 50 std::unique_ptr<Buffer> buffer( |
| 49 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 51 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
| 50 std::unique_ptr<Surface> surface(new Surface); | 52 std::unique_ptr<Surface> surface(new Surface); |
| 51 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 53 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 52 | 54 |
| 53 surface->Attach(buffer.get()); | 55 surface->Attach(buffer.get()); |
| 54 surface->Commit(); | 56 surface->Commit(); |
| 55 | 57 |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 592 aura::Window* window = widget->GetNativeWindow(); | 594 aura::Window* window = widget->GetNativeWindow(); |
| 593 | 595 |
| 594 // There is no shadow when started in maximized state. | 596 // There is no shadow when started in maximized state. |
| 595 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); | 597 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); |
| 596 | 598 |
| 597 // Sending a shadow bounds in maximized state won't create a shaodw. | 599 // Sending a shadow bounds in maximized state won't create a shaodw. |
| 598 shell_surface->SetRectangularShadow(gfx::Rect(10, 10, 100, 100)); | 600 shell_surface->SetRectangularShadow(gfx::Rect(10, 10, 100, 100)); |
| 599 surface->Commit(); | 601 surface->Commit(); |
| 600 | 602 |
| 601 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); | 603 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); |
| 604 // Underlay should be created even without shadow. | |
| 605 ASSERT_TRUE(shell_surface->shadow_underlay_); | |
| 606 EXPECT_TRUE(shell_surface->shadow_underlay_->IsVisible()); | |
| 602 | 607 |
| 603 // Restore the window and make sure the shadow is created, visible and | 608 // Restore the window and make sure the shadow is created, visible and |
| 604 // has the latest bounds. | 609 // has the latest bounds. |
| 605 widget->Restore(); | 610 widget->Restore(); |
| 606 wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window); | 611 wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window); |
| 607 ASSERT_TRUE(shadow); | 612 ASSERT_TRUE(shadow); |
| 608 EXPECT_TRUE(shadow->layer()->visible()); | 613 EXPECT_TRUE(shadow->layer()->visible()); |
| 609 EXPECT_EQ(gfx::Rect(10, 10, 100, 100), shadow->layer()->parent()->bounds()); | 614 EXPECT_EQ(gfx::Rect(10, 10, 100, 100), shadow->layer()->parent()->bounds()); |
| 610 } | 615 } |
| 611 | 616 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 637 shell_surface->GetWidget()->GetWindowBoundsInScreen().ToString()); | 642 shell_surface->GetWidget()->GetWindowBoundsInScreen().ToString()); |
| 638 | 643 |
| 639 // Leave fullscreen mode. | 644 // Leave fullscreen mode. |
| 640 window->GetWindowState()->OnWMEvent(&event); | 645 window->GetWindowState()->OnWMEvent(&event); |
| 641 | 646 |
| 642 // Check that shell surface is maximized. | 647 // Check that shell surface is maximized. |
| 643 EXPECT_EQ(CurrentContext()->bounds().width(), | 648 EXPECT_EQ(CurrentContext()->bounds().width(), |
| 644 shell_surface->GetWidget()->GetWindowBoundsInScreen().width()); | 649 shell_surface->GetWidget()->GetWindowBoundsInScreen().width()); |
| 645 } | 650 } |
| 646 | 651 |
| 647 } // namespace | |
|
oshima
2016/07/28 17:22:38
I remove this from the test bodies for test fixtur
| |
| 648 } // namespace exo | 652 } // namespace exo |
| OLD | NEW |