| 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/accessibility_delegate.h" | 6 #include "ash/common/accessibility_delegate.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/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 196 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 197 | 197 |
| 198 shell_surface->SetTitle(base::string16(base::ASCIIToUTF16("test"))); | 198 shell_surface->SetTitle(base::string16(base::ASCIIToUTF16("test"))); |
| 199 surface->Commit(); | 199 surface->Commit(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 TEST_F(ShellSurfaceTest, SetApplicationId) { | 202 TEST_F(ShellSurfaceTest, SetApplicationId) { |
| 203 std::unique_ptr<Surface> surface(new Surface); | 203 std::unique_ptr<Surface> surface(new Surface); |
| 204 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 204 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 205 | 205 |
| 206 EXPECT_EQ(nullptr, shell_surface->GetWidget()); |
| 207 shell_surface->SetApplicationId("pre-widget-id"); |
| 208 |
| 206 surface->Commit(); | 209 surface->Commit(); |
| 207 EXPECT_EQ("", ShellSurface::GetApplicationId( | 210 aura::Window* window = shell_surface->GetWidget()->GetNativeWindow(); |
| 208 shell_surface->GetWidget()->GetNativeWindow())); | 211 EXPECT_EQ("pre-widget-id", ShellSurface::GetApplicationId(window)); |
| 209 shell_surface->SetApplicationId("test"); | 212 shell_surface->SetApplicationId("test"); |
| 210 EXPECT_EQ("test", ShellSurface::GetApplicationId( | 213 EXPECT_EQ("test", ShellSurface::GetApplicationId(window)); |
| 211 shell_surface->GetWidget()->GetNativeWindow())); | |
| 212 } | 214 } |
| 213 | 215 |
| 214 TEST_F(ShellSurfaceTest, Move) { | 216 TEST_F(ShellSurfaceTest, Move) { |
| 215 std::unique_ptr<Surface> surface(new Surface); | 217 std::unique_ptr<Surface> surface(new Surface); |
| 216 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 218 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 217 | 219 |
| 218 // Map shell surface. | 220 // Map shell surface. |
| 219 surface->Commit(); | 221 surface->Commit(); |
| 220 | 222 |
| 221 // The interactive move should end when surface is destroyed. | 223 // The interactive move should end when surface is destroyed. |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 shell_surface.OnAccessibilityModeChanged(); | 807 shell_surface.OnAccessibilityModeChanged(); |
| 806 shell_surface2.OnAccessibilityModeChanged(); | 808 shell_surface2.OnAccessibilityModeChanged(); |
| 807 | 809 |
| 808 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); | 810 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); |
| 809 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); | 811 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); |
| 810 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); | 812 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); |
| 811 } | 813 } |
| 812 | 814 |
| 813 } // namespace | 815 } // namespace |
| 814 } // namespace exo | 816 } // namespace exo |
| OLD | NEW |