summaryrefslogtreecommitdiff
path: root/platform/qt/test/qmapboxgl.test.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-09-25 21:35:04 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-09-28 13:48:36 -0400
commit64c75b442c4d387e4867757abf49462c561e5955 (patch)
tree63f572961f6309a851d2e85ebe191e6a3cb7e5ab /platform/qt/test/qmapboxgl.test.hpp
parentd73e33eb62858b91212314d97bfe9cf49e857141 (diff)
downloadqtlocation-mapboxgl-64c75b442c4d387e4867757abf49462c561e5955.tar.gz
[build] split out DefaultFileSource and dependents to a separate target
We don't want to link it into the node bindings, so keep it in a separate target
Diffstat (limited to 'platform/qt/test/qmapboxgl.test.hpp')
-rw-r--r--platform/qt/test/qmapboxgl.test.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/platform/qt/test/qmapboxgl.test.hpp b/platform/qt/test/qmapboxgl.test.hpp
new file mode 100644
index 0000000000..04d63610ca
--- /dev/null
+++ b/platform/qt/test/qmapboxgl.test.hpp
@@ -0,0 +1,36 @@
+#include <mbgl/test/util.hpp>
+
+#include <QApplication>
+#include <QMapboxGL>
+
+// We're using QGLFramebufferObject, which is only available in Qt 5 and up.
+#if QT_VERSION >= 0x050000
+
+#include <QGLWidget>
+#include <QGLFramebufferObject>
+
+class QMapboxGLTest : public QObject, public ::testing::Test {
+ Q_OBJECT
+
+public:
+ QMapboxGLTest();
+
+ void runUntil(QMapboxGL::MapChange);
+
+private:
+ QGLWidget widget;
+ const QSize size;
+ QGLFramebufferObject fbo;
+
+protected:
+ QMapboxGLSettings settings;
+ QMapboxGL map;
+
+ std::function<void(QMapboxGL::MapChange)> changeCallback;
+
+private slots:
+ void onMapChanged(QMapboxGL::MapChange);
+ void onNeedsRendering();
+};
+
+#endif