aboutsummaryrefslogtreecommitdiff
path: root/plugins/ProfileEditor/test/main.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-04-25 22:09:13 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2020-05-26 12:50:15 +0300
commit0492a063806b6d63e4f378908b809de104a24820 (patch)
tree2e285d0c9b5067dc9395bfb751fe84bb8ac2a5f4 /plugins/ProfileEditor/test/main.cpp
parentlibwebengine (diff)
downloadsmolbote-0492a063806b6d63e4f378908b809de104a24820.tar.xz
Update ProfileEditor plugin
ProfileEditor: - add tests - disable read-only settings on otr profiles Add WebProfile::setHeaders and WebProfile::setCookies
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();
+}