| 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 "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
| 6 | 6 |
| 7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
| 9 #include "ash/public/cpp/window_properties.h" | 9 #include "ash/public/cpp/window_properties.h" |
| 10 #include "ash/public/interfaces/window_pin_type.mojom.h" | 10 #include "ash/public/interfaces/window_pin_type.mojom.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 243 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
| 244 std::unique_ptr<Surface> surface(new Surface); | 244 std::unique_ptr<Surface> surface(new Surface); |
| 245 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 245 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 246 | 246 |
| 247 EXPECT_EQ(nullptr, shell_surface->GetWidget()); | 247 EXPECT_EQ(nullptr, shell_surface->GetWidget()); |
| 248 shell_surface->SetApplicationId("pre-widget-id"); | 248 shell_surface->SetApplicationId("pre-widget-id"); |
| 249 | 249 |
| 250 surface->Attach(buffer.get()); | 250 surface->Attach(buffer.get()); |
| 251 surface->Commit(); | 251 surface->Commit(); |
| 252 aura::Window* window = shell_surface->GetWidget()->GetNativeWindow(); | 252 aura::Window* window = shell_surface->GetWidget()->GetNativeWindow(); |
| 253 EXPECT_EQ("pre-widget-id", ShellSurface::GetApplicationId(window)); | 253 EXPECT_EQ("pre-widget-id", *ShellSurface::GetApplicationId(window)); |
| 254 shell_surface->SetApplicationId("test"); | 254 shell_surface->SetApplicationId("test"); |
| 255 EXPECT_EQ("test", ShellSurface::GetApplicationId(window)); | 255 EXPECT_EQ("test", *ShellSurface::GetApplicationId(window)); |
| 256 } | 256 } |
| 257 | 257 |
| 258 TEST_F(ShellSurfaceTest, Move) { | 258 TEST_F(ShellSurfaceTest, Move) { |
| 259 std::unique_ptr<Surface> surface(new Surface); | 259 std::unique_ptr<Surface> surface(new Surface); |
| 260 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 260 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 261 | 261 |
| 262 // Map shell surface. | 262 // Map shell surface. |
| 263 surface->Commit(); | 263 surface->Commit(); |
| 264 | 264 |
| 265 // The interactive move should end when surface is destroyed. | 265 // The interactive move should end when surface is destroyed. |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 shell_surface->surface_for_testing()->window()->bounds().size()); | 973 shell_surface->surface_for_testing()->window()->bounds().size()); |
| 974 | 974 |
| 975 ash::wm::WMEvent minimize_event(ash::wm::WM_EVENT_MINIMIZE); | 975 ash::wm::WMEvent minimize_event(ash::wm::WM_EVENT_MINIMIZE); |
| 976 ash::WmWindow* window = | 976 ash::WmWindow* window = |
| 977 ash::WmWindow::Get(shell_surface->GetWidget()->GetNativeWindow()); | 977 ash::WmWindow::Get(shell_surface->GetWidget()->GetNativeWindow()); |
| 978 window->GetWindowState()->OnWMEvent(&minimize_event); | 978 window->GetWindowState()->OnWMEvent(&minimize_event); |
| 979 } | 979 } |
| 980 | 980 |
| 981 } // namespace | 981 } // namespace |
| 982 } // namespace exo | 982 } // namespace exo |
| OLD | NEW |