OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "components/exo/shell_surface.h" |
| 7 #include "components/exo/surface.h" |
| 8 #include "components/exo/test/exo_test_base.h" |
| 9 #include "components/exo/test/exo_test_helper.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 namespace exo { |
| 13 namespace { |
| 14 |
| 15 using ShellSurfaceTest = test::ExoTestBase; |
| 16 |
| 17 TEST_F(ShellSurfaceTest, Show) { |
| 18 scoped_ptr<Surface> surface(new Surface); |
| 19 scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 20 |
| 21 shell_surface->Show(); |
| 22 surface->Commit(); |
| 23 } |
| 24 |
| 25 TEST_F(ShellSurfaceTest, SetToplevel) { |
| 26 scoped_ptr<Surface> surface(new Surface); |
| 27 scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 28 |
| 29 shell_surface->SetToplevel(); |
| 30 surface->Commit(); |
| 31 } |
| 32 |
| 33 TEST_F(ShellSurfaceTest, SetFullscreen) { |
| 34 scoped_ptr<Surface> surface(new Surface); |
| 35 scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 36 |
| 37 shell_surface->SetFullscreen(true); |
| 38 surface->Commit(); |
| 39 |
| 40 // Fullscreen mode can change after the initial Commit(). |
| 41 shell_surface->SetFullscreen(false); |
| 42 surface->Commit(); |
| 43 } |
| 44 |
| 45 TEST_F(ShellSurfaceTest, SetTitle) { |
| 46 scoped_ptr<Surface> surface(new Surface); |
| 47 scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 48 |
| 49 shell_surface->SetTitle(base::string16(base::ASCIIToUTF16("test"))); |
| 50 surface->Commit(); |
| 51 } |
| 52 |
| 53 } // namespace |
| 54 } // namespace exo |
OLD | NEW |