mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-05-30 22:01:41 +00:00
test: 修改单元覆盖率脚本,添加部分类的单元测试
之前的脚本文件统计时会有很多文件实际已经覆盖,但测试的结果显示未覆盖,重新修改了下,目前基本正常 Log: Change-Id: I8a9b05da6ada085f8e308eb558730a92217d154f
This commit is contained in:
parent
f369877690
commit
1597fab278
@ -1,17 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 需要先安装lcov,打开./unittest/CMakeLists.txt 测试覆盖率的编译条件
|
||||
# 需要先安装lcov,打开./tests/CMakeLists.txt 测试覆盖率的编译条件
|
||||
# 将该脚本放置到dde-dock-unit_test二进制文件同级目录运行
|
||||
lcov -c -i -d ./ -o init.info
|
||||
./dde_dock_unit_test
|
||||
lcov -c -d ./ -o cover.info
|
||||
lcov -a init.info -a cover.info -o total.info
|
||||
lcov --remove total.info '*/usr/include/*' '*/usr/lib/*' '*/usr/lib64/*' '*/usr/local/include/*' '*/usr/local/lib/*' '*/usr/local/lib64/*' '*/third/*' '*/tests/dde_dock_unit_test_autogen/*' '*/dde-dock/frame/dbus/*' '*/dde-dock/interfaces/*' '*/dde-dock/tests/*' -o final.info
|
||||
|
||||
# 生成报告
|
||||
genhtml -o cover_report --legend --title "lcov" --prefix=./ final.info
|
||||
workdir=.
|
||||
executable=dde_dock_unit_test
|
||||
build_dir=$workdir
|
||||
result_coverage_dir=$build_dir/coverage
|
||||
result_report_dir=$build_dir/report/report.xml
|
||||
$build_dir/$executable --gtest_output=xml:$result_report_dir
|
||||
|
||||
#打开报告
|
||||
nohup x-www-browser ./cover_report/index.html &
|
||||
# 剔除无效信息
|
||||
lcov -d $build_dir -c -o $build_dir/coverage.info -o $build_dir/coverage.info
|
||||
lcov --extract $build_dir/coverage.info '*/frame/*' '*/widgets/*' -o $build_dir/coverage.info
|
||||
lcov --remove $build_dir/coverage.info '*/tests/*' '*/dbus/*' '*/xcb/*' -o $build_dir/coverage.info
|
||||
|
||||
exit 0
|
||||
lcov --list-full-path -e $build_dir/coverage.info –o $build_dir/coverage-stripped.info
|
||||
genhtml -o $result_coverage_dir $build_dir/coverage.info
|
||||
nohup x-www-browser $result_coverage_dir/index.html &
|
||||
#nohup x-www-browser $result_report_dir &
|
||||
lcov -d $build_dir –z
|
||||
exit 0
|
@ -1,50 +0,0 @@
|
||||
#include "dockrect.h"
|
||||
#include <QDebug>
|
||||
|
||||
DockRect::DockRect()
|
||||
: x(0)
|
||||
, y(0)
|
||||
, w(0)
|
||||
, h(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug debug, const DockRect &rect)
|
||||
{
|
||||
debug << QString("DockRect(%1, %2, %3, %4)").arg(rect.x)
|
||||
.arg(rect.y)
|
||||
.arg(rect.w)
|
||||
.arg(rect.h);
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
DockRect::operator QRect() const
|
||||
{
|
||||
return QRect(x, y, w, h);
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &arg, const DockRect &rect)
|
||||
{
|
||||
arg.beginStructure();
|
||||
arg << rect.x << rect.y << rect.w << rect.h;
|
||||
arg.endStructure();
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &arg, DockRect &rect)
|
||||
{
|
||||
arg.beginStructure();
|
||||
arg >> rect.x >> rect.y >> rect.w >> rect.h;
|
||||
arg.endStructure();
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
void registerDockRectMetaType()
|
||||
{
|
||||
qRegisterMetaType<DockRect>("DockRect");
|
||||
qDBusRegisterMetaType<DockRect>();
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
#ifndef DOCKRECT_H
|
||||
#define DOCKRECT_H
|
||||
|
||||
#include <QRect>
|
||||
#include <QDBusMetaType>
|
||||
|
||||
struct DockRect
|
||||
{
|
||||
public:
|
||||
DockRect();
|
||||
operator QRect() const;
|
||||
|
||||
friend QDebug operator<<(QDebug debug, const DockRect &rect);
|
||||
friend const QDBusArgument &operator>>(const QDBusArgument &arg, DockRect &rect);
|
||||
friend QDBusArgument &operator<<(QDBusArgument &arg, const DockRect &rect);
|
||||
|
||||
private:
|
||||
int x;
|
||||
int y;
|
||||
uint w;
|
||||
uint h;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(DockRect)
|
||||
|
||||
void registerDockRectMetaType();
|
||||
|
||||
#endif // DOCKRECT_H
|
@ -1,338 +0,0 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -a fake_com_deepin_dde_daemon_dock -c FakeDaemonDock com.deepin.dde.daemon.Dock.xml
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "fake_com_deepin_dde_daemon_dock.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
static QStringList dockedlist = {"/usr/share/applications/dde-file-manager.desktop",
|
||||
"/usr/share/applications/deepin-album.desktop",
|
||||
"/usr/share/applications/deepin-music.desktop",
|
||||
"/usr/share/applications/deepin-contacts.desktop",
|
||||
"/usr/share/applications/dde-calendar.desktop",
|
||||
"/usr/share/applications/dde-control-center.desktop",
|
||||
"/usr/share/applications/google-chrome.desktop",
|
||||
"/usr/share/applications/org.qt-project.qtcreator.desktop",
|
||||
"/usr/share/applications/com.syntevo.smartgit.desktop"};
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class FakeDaemonDock
|
||||
*/
|
||||
|
||||
FakeDaemonDock::FakeDaemonDock(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
FakeDaemonDock::~FakeDaemonDock()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
int FakeDaemonDock::displayMode() const
|
||||
{
|
||||
// get the value of property DisplayMode
|
||||
return m_displayMode;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setDisplayMode(int value)
|
||||
{
|
||||
// set the value of property DisplayMode
|
||||
m_displayMode = value;
|
||||
}
|
||||
|
||||
QStringList FakeDaemonDock::dockedApps() const
|
||||
{
|
||||
// get the value of property DockedApps
|
||||
return qvariant_cast< QStringList >(parent()->property("DockedApps"));
|
||||
}
|
||||
|
||||
QList<QDBusObjectPath> FakeDaemonDock::entries() const
|
||||
{
|
||||
// get the value of property Entries
|
||||
static QList<QDBusObjectPath> pathList = {QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e0T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e1T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e2T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e3T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e4T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e5T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e6T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e7T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e8T6045b766")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e17T6045ba37")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e20T6045bdd4")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e22T6045bede")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e33T6045c648")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e43T6045cea2")
|
||||
, QDBusObjectPath("/com/deepin/dde/daemon/Dock/entries/e44T6045d157")
|
||||
};
|
||||
|
||||
return pathList;
|
||||
}
|
||||
|
||||
DockRect FakeDaemonDock::frontendWindowRect() const
|
||||
{
|
||||
// get the value of property FrontendWindowRect
|
||||
|
||||
return qvariant_cast< DockRect >(parent()->property("FrontendWindowRect"));
|
||||
}
|
||||
|
||||
int FakeDaemonDock::hideMode() const
|
||||
{
|
||||
// get the value of property HideMode
|
||||
return m_hideMode;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setHideMode(int value)
|
||||
{
|
||||
// set the value of property HideMode
|
||||
m_hideMode = value;
|
||||
}
|
||||
|
||||
int FakeDaemonDock::hideState() const
|
||||
{
|
||||
// get the value of property HideState
|
||||
return m_hideState;
|
||||
}
|
||||
|
||||
uint FakeDaemonDock::hideTimeout() const
|
||||
{
|
||||
return m_hideTimeout;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setHideTimeout(uint value)
|
||||
{
|
||||
m_hideTimeout = value;
|
||||
}
|
||||
|
||||
uint FakeDaemonDock::iconSize() const
|
||||
{
|
||||
// get the value of property IconSize
|
||||
return qvariant_cast< uint >(parent()->property("IconSize"));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setIconSize(uint value)
|
||||
{
|
||||
// set the value of property IconSize
|
||||
parent()->setProperty("IconSize", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
double FakeDaemonDock::opacity() const
|
||||
{
|
||||
return m_opacity;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setOpacity(double value)
|
||||
{
|
||||
m_opacity = value;
|
||||
}
|
||||
|
||||
int FakeDaemonDock::position() const
|
||||
{
|
||||
return m_position;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setPosition(int value)
|
||||
{
|
||||
m_position = value;
|
||||
}
|
||||
|
||||
uint FakeDaemonDock::showTimeout() const
|
||||
{
|
||||
// get the value of property ShowTimeout
|
||||
return qvariant_cast< uint >(parent()->property("ShowTimeout"));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setShowTimeout(uint value)
|
||||
{
|
||||
// set the value of property ShowTimeout
|
||||
parent()->setProperty("ShowTimeout", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
uint FakeDaemonDock::windowSize() const
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setWindowSize(uint value)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
uint FakeDaemonDock::windowSizeEfficient() const
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setWindowSizeEfficient(uint value)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
uint FakeDaemonDock::windowSizeFashion() const
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::setWindowSizeFashion(uint value)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
void FakeDaemonDock::ActivateWindow(uint in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.ActivateWindow
|
||||
QMetaObject::invokeMethod(parent(), "ActivateWindow", Q_ARG(uint, in0));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::CancelPreviewWindow()
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.CancelPreviewWindow
|
||||
QMetaObject::invokeMethod(parent(), "CancelPreviewWindow");
|
||||
}
|
||||
|
||||
void FakeDaemonDock::CloseWindow(uint in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.CloseWindow
|
||||
QMetaObject::invokeMethod(parent(), "CloseWindow", Q_ARG(uint, in0));
|
||||
}
|
||||
|
||||
QStringList FakeDaemonDock::GetDockedAppsDesktopFiles()
|
||||
{
|
||||
return dockedlist;
|
||||
}
|
||||
|
||||
QStringList FakeDaemonDock::GetEntryIDs()
|
||||
{
|
||||
static QStringList list = {"dde-file-manager",
|
||||
"deepin-album",
|
||||
"deepin-music",
|
||||
"deepin-contacts",
|
||||
"dde-calendar",
|
||||
"dde-control-center",
|
||||
"google-chrome",
|
||||
"org.qt-project.qtcreator",
|
||||
"com.syntevo.smartgit",
|
||||
"deepin-terminal",
|
||||
"org.gnome.dfeet",
|
||||
"wps-office-et",
|
||||
"org.gnome.Terminal",
|
||||
"code",
|
||||
"ca.desrt.dconf-editor",
|
||||
"deepin-editor"};
|
||||
return list;
|
||||
}
|
||||
|
||||
QString FakeDaemonDock::GetPluginSettings()
|
||||
{
|
||||
static QString str = "'{\"AiAssistant\":{\"pos_1\":1},\"datetime\":{\"Use24HourFormat\":true,\"pos_datetime_1\":3},\"disk-mount\":{\"holded_mount-item-key\":false},\"multitasking\":{\"pos_multitasking_1\":2},\"network\":{\"holded_network-item-key\":false},\"notifications\":{\"pos_notifications_1\":5},\"show-desktop\":{\"pos_show-desktop_1\":1},\"shutdown\":{\"pos_shutdown_1\":2},\"sound\":{\"holded_sound-item-key\":false},\"trash\":{\"pos_trash_1\":4},\"tray\":{\"fashion-tray-expanded\":true,\"holded_sni:fcitx-qimpanel\":false,\"holded_window:Deepin-WXWork\":false,\"holded_window:Deepin-WeChat\":false}}'";
|
||||
return str;
|
||||
}
|
||||
|
||||
bool FakeDaemonDock::IsDocked(const QString &in0)
|
||||
{
|
||||
return dockedlist.contains(in0);
|
||||
}
|
||||
|
||||
bool FakeDaemonDock::IsOnDock(const QString &in0)
|
||||
{
|
||||
return dockedlist.contains(in0);
|
||||
}
|
||||
|
||||
void FakeDaemonDock::MakeWindowAbove(uint in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.MakeWindowAbove
|
||||
QMetaObject::invokeMethod(parent(), "MakeWindowAbove", Q_ARG(uint, in0));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::MaximizeWindow(uint in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.MaximizeWindow
|
||||
QMetaObject::invokeMethod(parent(), "MaximizeWindow", Q_ARG(uint, in0));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::MergePluginSettings(const QString &in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.MergePluginSettings
|
||||
QMetaObject::invokeMethod(parent(), "MergePluginSettings", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::MinimizeWindow(uint in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.MinimizeWindow
|
||||
QMetaObject::invokeMethod(parent(), "MinimizeWindow", Q_ARG(uint, in0));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::MoveEntry(int in0, int in1)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.MoveEntry
|
||||
QMetaObject::invokeMethod(parent(), "MoveEntry", Q_ARG(int, in0), Q_ARG(int, in1));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::MoveWindow(uint in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.MoveWindow
|
||||
QMetaObject::invokeMethod(parent(), "MoveWindow", Q_ARG(uint, in0));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::PreviewWindow(uint in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.PreviewWindow
|
||||
QMetaObject::invokeMethod(parent(), "PreviewWindow", Q_ARG(uint, in0));
|
||||
}
|
||||
|
||||
QString FakeDaemonDock::QueryWindowIdentifyMethod(uint in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.QueryWindowIdentifyMethod
|
||||
QString out0;
|
||||
QMetaObject::invokeMethod(parent(), "QueryWindowIdentifyMethod", Q_RETURN_ARG(QString, out0), Q_ARG(uint, in0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::RemovePluginSettings(const QString &in0, const QStringList &in1)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.RemovePluginSettings
|
||||
QMetaObject::invokeMethod(parent(), "RemovePluginSettings", Q_ARG(QString, in0), Q_ARG(QStringList, in1));
|
||||
}
|
||||
|
||||
bool FakeDaemonDock::RequestDock(const QString &in0, int in1)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.RequestDock
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "RequestDock", Q_RETURN_ARG(bool, out0), Q_ARG(QString, in0), Q_ARG(int, in1));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool FakeDaemonDock::RequestUndock(const QString &in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.RequestUndock
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "RequestUndock", Q_RETURN_ARG(bool, out0), Q_ARG(QString, in0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
void FakeDaemonDock::SetFrontendWindowRect(int in0, int in1, uint in2, uint in3)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.SetFrontendWindowRect
|
||||
QMetaObject::invokeMethod(parent(), "SetFrontendWindowRect", Q_ARG(int, in0), Q_ARG(int, in1), Q_ARG(uint, in2), Q_ARG(uint, in3));
|
||||
}
|
||||
|
||||
void FakeDaemonDock::SetPluginSettings(const QString &in0)
|
||||
{
|
||||
// handle method call com.deepin.dde.daemon.Dock.SetPluginSettings
|
||||
QMetaObject::invokeMethod(parent(), "SetPluginSettings", Q_ARG(QString, in0));
|
||||
}
|
||||
|
@ -1,233 +0,0 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -a fake_com_deepin_dde_daemon_dock -c FakeDaemonDock com.deepin.dde.daemon.Dock.xml
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef FAKE_COM_DEEPIN_DDE_DAEMON_DOCK_H
|
||||
#define FAKE_COM_DEEPIN_DDE_DAEMON_DOCK_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
#include "dockrect.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface com.deepin.dde.daemon.Dock
|
||||
*/
|
||||
class FakeDaemonDock: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "com.deepin.dde.daemon.Dock")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"com.deepin.dde.daemon.Dock\">\n"
|
||||
" <method name=\"ActivateWindow\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"CancelPreviewWindow\"/>\n"
|
||||
" <method name=\"CloseWindow\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetDockedAppsDesktopFiles\">\n"
|
||||
" <arg direction=\"out\" type=\"as\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetEntryIDs\">\n"
|
||||
" <arg direction=\"out\" type=\"as\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetPluginSettings\">\n"
|
||||
" <arg direction=\"out\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"IsDocked\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"IsOnDock\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"MakeWindowAbove\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"MaximizeWindow\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"MinimizeWindow\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"MoveEntry\">\n"
|
||||
" <arg direction=\"in\" type=\"i\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"MoveWindow\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"PreviewWindow\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"QueryWindowIdentifyMethod\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" <arg direction=\"out\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RemovePluginSettings\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"as\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RequestDock\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\"/>\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RequestUndock\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetFrontendWindowRect\">\n"
|
||||
" <arg direction=\"in\" type=\"i\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\"/>\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetPluginSettings\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"MergePluginSettings\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <signal name=\"ServiceRestarted\"/>\n"
|
||||
" <signal name=\"EntryAdded\">\n"
|
||||
" <arg type=\"o\"/>\n"
|
||||
" <arg type=\"i\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"EntryRemoved\">\n"
|
||||
" <arg type=\"s\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"PluginSettingsSynced\"/>\n"
|
||||
" <signal name=\"DockAppSettingsSynced\"/>\n"
|
||||
" <property access=\"read\" type=\"ao\" name=\"Entries\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"HideMode\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"DisplayMode\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"Position\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"IconSize\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"WindowSize\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"WindowSizeEfficient\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"WindowSizeFashion\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"ShowTimeout\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"HideTimeout\"/>\n"
|
||||
" <property access=\"read\" type=\"as\" name=\"DockedApps\"/>\n"
|
||||
" <property access=\"read\" type=\"i\" name=\"HideState\"/>\n"
|
||||
" <property access=\"read\" type=\"(iiuu)\" name=\"FrontendWindowRect\">\n"
|
||||
" <annotation value=\"DockRect\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"readwrite\" type=\"d\" name=\"Opacity\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
FakeDaemonDock(QObject *parent);
|
||||
virtual ~FakeDaemonDock();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(int DisplayMode READ displayMode WRITE setDisplayMode)
|
||||
int displayMode() const;
|
||||
void setDisplayMode(int value);
|
||||
|
||||
Q_PROPERTY(QStringList DockedApps READ dockedApps)
|
||||
QStringList dockedApps() const;
|
||||
|
||||
Q_PROPERTY(QList<QDBusObjectPath> Entries READ entries)
|
||||
QList<QDBusObjectPath> entries() const;
|
||||
|
||||
Q_PROPERTY(DockRect FrontendWindowRect READ frontendWindowRect)
|
||||
DockRect frontendWindowRect() const;
|
||||
|
||||
Q_PROPERTY(int HideMode READ hideMode WRITE setHideMode)
|
||||
int hideMode() const;
|
||||
void setHideMode(int value);
|
||||
|
||||
Q_PROPERTY(int HideState READ hideState)
|
||||
int hideState() const;
|
||||
|
||||
Q_PROPERTY(uint HideTimeout READ hideTimeout WRITE setHideTimeout)
|
||||
uint hideTimeout() const;
|
||||
void setHideTimeout(uint value);
|
||||
|
||||
Q_PROPERTY(uint IconSize READ iconSize WRITE setIconSize)
|
||||
uint iconSize() const;
|
||||
void setIconSize(uint value);
|
||||
|
||||
Q_PROPERTY(double Opacity READ opacity WRITE setOpacity)
|
||||
double opacity() const;
|
||||
void setOpacity(double value);
|
||||
|
||||
Q_PROPERTY(int Position READ position WRITE setPosition)
|
||||
int position() const;
|
||||
void setPosition(int value);
|
||||
|
||||
Q_PROPERTY(uint ShowTimeout READ showTimeout WRITE setShowTimeout)
|
||||
uint showTimeout() const;
|
||||
void setShowTimeout(uint value);
|
||||
|
||||
Q_PROPERTY(uint WindowSize READ windowSize WRITE setWindowSize)
|
||||
uint windowSize() const;
|
||||
void setWindowSize(uint value);
|
||||
|
||||
Q_PROPERTY(uint WindowSizeEfficient READ windowSizeEfficient WRITE setWindowSizeEfficient)
|
||||
uint windowSizeEfficient() const;
|
||||
void setWindowSizeEfficient(uint value);
|
||||
|
||||
Q_PROPERTY(uint WindowSizeFashion READ windowSizeFashion WRITE setWindowSizeFashion)
|
||||
uint windowSizeFashion() const;
|
||||
void setWindowSizeFashion(uint value);
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
void ActivateWindow(uint in0);
|
||||
void CancelPreviewWindow();
|
||||
void CloseWindow(uint in0);
|
||||
QStringList GetDockedAppsDesktopFiles();
|
||||
QStringList GetEntryIDs();
|
||||
QString GetPluginSettings();
|
||||
bool IsDocked(const QString &in0);
|
||||
bool IsOnDock(const QString &in0);
|
||||
void MakeWindowAbove(uint in0);
|
||||
void MaximizeWindow(uint in0);
|
||||
void MergePluginSettings(const QString &in0);
|
||||
void MinimizeWindow(uint in0);
|
||||
void MoveEntry(int in0, int in1);
|
||||
void MoveWindow(uint in0);
|
||||
void PreviewWindow(uint in0);
|
||||
QString QueryWindowIdentifyMethod(uint in0);
|
||||
void RemovePluginSettings(const QString &in0, const QStringList &in1);
|
||||
bool RequestDock(const QString &in0, int in1);
|
||||
bool RequestUndock(const QString &in0);
|
||||
void SetFrontendWindowRect(int in0, int in1, uint in2, uint in3);
|
||||
void SetPluginSettings(const QString &in0);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void DockAppSettingsSynced();
|
||||
void EntryAdded(const QDBusObjectPath &in0, int in1);
|
||||
void EntryRemoved(const QString &in0);
|
||||
void PluginSettingsSynced();
|
||||
void ServiceRestarted();
|
||||
|
||||
private:
|
||||
int m_position = 2;
|
||||
int m_displayMode = 1;
|
||||
int m_hideMode = 0;
|
||||
int m_hideState = 0;
|
||||
int m_hideTimeout = 0;
|
||||
double m_opacity = 0.4;
|
||||
};
|
||||
|
||||
#endif
|
@ -42,7 +42,7 @@ void Test_AppDragWidget::TearDown()
|
||||
{
|
||||
}
|
||||
|
||||
TEST_F(Test_AppDragWidget, cuntion_test)
|
||||
TEST_F(Test_AppDragWidget, funtion_test)
|
||||
{
|
||||
AppDragWidget *dragWidget = new AppDragWidget;
|
||||
|
||||
|
@ -66,8 +66,8 @@ TEST_F(Test_MainWindow, coverage_test)
|
||||
m_window->callShow();
|
||||
QTest::qWait(450);
|
||||
|
||||
// m_window->relaodPlugins();
|
||||
// QTest::qWait(100);
|
||||
//TODO 这里无论输入什么,均返回true
|
||||
// ASSERT_FALSE(m_window->appIsOnDock("testname"));
|
||||
|
||||
QEvent enterEvent(QEvent::Enter);
|
||||
qApp->sendEvent(m_window, &enterEvent);
|
||||
@ -82,10 +82,4 @@ TEST_F(Test_MainWindow, coverage_test)
|
||||
qApp->sendEvent(m_window->m_dragWidget, &dragLeaveEvent);
|
||||
QTest::qWait(10);
|
||||
ASSERT_EQ(QApplication::overrideCursor()->shape(), Qt::ArrowCursor);
|
||||
|
||||
// QTest::mouseClick(m_window, Qt::RightButton, Qt::NoModifier, QPoint(100 ,10));
|
||||
// QTest::qWait(10);
|
||||
|
||||
// QTest::mouseClick(m_window, Qt::LeftButton, Qt::NoModifier, QPoint(0 ,0));
|
||||
// QTest::qWait(10);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user