summaryrefslogtreecommitdiffstats
path: root/components/exo/shell_surface_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'components/exo/shell_surface_unittest.cc')
-rw-r--r--components/exo/shell_surface_unittest.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc
new file mode 100644
index 0000000..6ade284
--- /dev/null
+++ b/components/exo/shell_surface_unittest.cc
@@ -0,0 +1,54 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/strings/utf_string_conversions.h"
+#include "components/exo/shell_surface.h"
+#include "components/exo/surface.h"
+#include "components/exo/test/exo_test_base.h"
+#include "components/exo/test/exo_test_helper.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace exo {
+namespace {
+
+using ShellSurfaceTest = test::ExoTestBase;
+
+TEST_F(ShellSurfaceTest, Show) {
+ scoped_ptr<Surface> surface(new Surface);
+ scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+
+ shell_surface->Show();
+ surface->Commit();
+}
+
+TEST_F(ShellSurfaceTest, SetToplevel) {
+ scoped_ptr<Surface> surface(new Surface);
+ scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+
+ shell_surface->SetToplevel();
+ surface->Commit();
+}
+
+TEST_F(ShellSurfaceTest, SetFullscreen) {
+ scoped_ptr<Surface> surface(new Surface);
+ scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+
+ shell_surface->SetFullscreen(true);
+ surface->Commit();
+
+ // Fullscreen mode can change after the initial Commit().
+ shell_surface->SetFullscreen(false);
+ surface->Commit();
+}
+
+TEST_F(ShellSurfaceTest, SetTitle) {
+ scoped_ptr<Surface> surface(new Surface);
+ scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+
+ shell_surface->SetTitle(base::string16(base::ASCIIToUTF16("test")));
+ surface->Commit();
+}
+
+} // namespace
+} // namespace exo