MCPcopy Create free account
hub / github.com/KDE/kdevelop / loadPluginNormalDefaults

Method loadPluginNormalDefaults

kdevplatform/shell/tests/test_pluginenabling.cpp:111–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void TestPluginEnabling::loadPluginNormalDefaults()
112{
113 QFETCH(QString, pluginId);
114 QFETCH(bool, shouldBeEnabled);
115
116 AutoTestShell::init();
117 // see TODO in loadPluginCustomDefaults()
118 TestCore::initialize(Core::NoUi, QStringLiteral("test_pluginenabling_normal_")+pluginId);
119 TestCore::self()->activeSession()->setTemporary(true);
120 m_pluginCtrl = Core::self()->pluginControllerInternal();
121
122 // check plugin metadata
123 const auto pluginInfo = m_pluginCtrl->infoForPluginId(pluginId);
124 // logic in kdevelop different from KPluginMetaData::isEnabledByDefault(), here defaults to true
125 const QJsonValue enabledByDefaultValue = pluginInfo.rawData()["KPlugin"].toObject()["EnabledByDefault"];
126 const bool enabledByDefault = (enabledByDefaultValue.isNull() || enabledByDefaultValue.toBool());
127 QCOMPARE(enabledByDefault, shouldBeEnabled);
128
129 loadPlugin(pluginId, shouldBeEnabled);
130
131 TestCore::shutdown();
132}
133
134QTEST_MAIN(TestPluginEnabling)
135

Callers

nothing calls this directly

Calls 7

initializeFunction · 0.85
setTemporaryMethod · 0.80
infoForPluginIdMethod · 0.80
isNullMethod · 0.80
initFunction · 0.50
activeSessionMethod · 0.45

Tested by

no test coverage detected