summaryrefslogtreecommitdiff
path: root/tests
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-08-31 17:11:46 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-08-31 17:11:46 +0200
commitf3cc0108475a83380002c18ba4c8961ac3d1699b (patch)
tree7c703b44324f878e19c0c32701449492ab96d618 /tests
parent55c3c9a4fcd743802a6bfbd0ac36130c95d2da63 (diff)
tests, TestLauncherDragWindow: added skeleton test class
(bzr r2641.1.9)
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/test_launcher_drag_window.cpp55
2 files changed, 56 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a608ba2b4..37be4e84a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -213,6 +213,7 @@ if (GTEST_SRC_DIR AND
test_icon_loader.cpp
test_im_text_entry.cpp
test_launcher_controller.cpp
+ test_launcher_drag_window.cpp
test_keyboard_util.cpp
test_panel_style.cpp
test_previews_application.cpp
diff --git a/tests/test_launcher_drag_window.cpp b/tests/test_launcher_drag_window.cpp
new file mode 100644
index 000000000..ade405114
--- /dev/null
+++ b/tests/test_launcher_drag_window.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2012 Canonical Ltd.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 3, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranties of
+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 3 along with this program. If not, see
+ * <http://www.gnu.org/licenses/>
+ *
+ * Authored by: Marco Trevisan (Treviño) <marco.trevisan@canonical.com>
+ */
+
+#include <gmock/gmock.h>
+
+#include "LauncherDragWindow.h"
+
+using namespace unity::launcher;
+using namespace testing;
+
+namespace
+{
+const int ICON_WIDTH = 10;
+const int ICON_HEIGHT = 15;
+}
+
+namespace unity
+{
+namespace launcher
+{
+struct TestLauncherDragWindow : public testing::Test
+{
+ TestLauncherDragWindow()
+ : drag_window(nux::ObjectPtr<nux::IOpenGLBaseTexture>(new nux::IOpenGLBaseTexture(nux::RTTEXTURE, ICON_WIDTH, ICON_HEIGHT, 24, 1, nux::BITFMT_B8G8R8A8)))
+ {}
+
+ LauncherDragWindow drag_window;
+};
+}
+
+TEST_F(TestLauncherDragWindow, Construction)
+{
+ EXPECT_EQ(drag_window.GetBaseWidth(), ICON_WIDTH);
+ EXPECT_EQ(drag_window.GetBaseHeight(), ICON_HEIGHT);
+ EXPECT_FALSE(drag_window.Animating());
+ EXPECT_FALSE(drag_window.Cancelled());
+}
+
+}