aboutsummaryrefslogtreecommitdiff
path: root/plugins/ProfileEditor/test/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ProfileEditor/test/main.cpp')
-rw-r--r--plugins/ProfileEditor/test/main.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/ProfileEditor/test/main.cpp b/plugins/ProfileEditor/test/main.cpp
new file mode 100644
index 0000000..40b563c
--- /dev/null
+++ b/plugins/ProfileEditor/test/main.cpp
@@ -0,0 +1,22 @@
+#include <QApplication>
+#include "profileeditorplugin.h"
+#include <QDialog>
+#include <QTimer>
+#include <QWebEngineProfile>
+
+int main(int argc, char** argv)
+{
+ QApplication app(argc, argv);
+ ProfileEditorPlugin plugin;
+
+ auto *dlg = dynamic_cast<ProfileDialog*>(plugin.createWidget(nullptr));
+ const auto i = dlg->addProfile("id", "testing", new QWebEngineProfile, new QSettings(QString(), QSettings::IniFormat, &app));
+ dlg->show();
+
+ if(qEnvironmentVariableIsSet("autoclose")) {
+ dlg->showProfile(i);
+ QTimer::singleShot(200, dlg, &QDialog::accept);
+ }
+
+ return app.exec();
+}