| 1 | /* |
| 2 | * Copyright (C) 2013 Canonical Ltd. |
| 3 | * |
| 4 | * Contact: Alberto Mardegan <[email protected]> |
| 5 | * |
| 6 | * This file is part of liblomiri-online-accounts-plugin |
| 7 | * |
| 8 | * This program is free software: you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License version 3, as published |
| 10 | * by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranties of |
| 14 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include <LomiriOnlineAccountsPlugin/application-manager.h>cxx . . $ `<file>/online-accounts-plugins/lib/LomiriOnlineAccountsPlugin/application-manager.h`/ |
| 22 | |
| 23 | #include <Accounts/Account> |
| 24 | #include <Accounts/Manager> |
| 25 | #include <QDebug> |
| 26 | #include <QDir> |
| 27 | #include <QQmlComponent> |
| 28 | #include <QQmlContext> |
| 29 | #include <QQmlEngine> |
| 30 | #include <QSignalSpy> |
| 31 | #include <QTest> |
| 32 | |
| 33 | #define TEST_DIRcxx . . $ `tests/online-accounts-plugins/lib/tst_application_manager.cpp:33:9`! TMP_DIRcxx . . $ `<built-in>:485:9`! "/tst_application_manager" |
| 34 | |
| 35 | using namespace OnlineAccountsUi; |
| 36 | |
| 37 | class ApplicationManagerTestcxx . . $ ApplicationManagerTest#: public QObjectcxx . . $ QObject# |
| 38 | { |
| 39 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 40 | |
| 41 | public: |
| 42 | ApplicationManagerTestcxx . . $ ApplicationManagerTest#ApplicationManagerTest(49f6e7a06ebc5aa8).(); |
| 43 | |
| 44 | private Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 45 | void initTestCasecxx . . $ ApplicationManagerTest#initTestCase(49f6e7a06ebc5aa8).(); |
| 46 | void testNonExistingAppcxx . . $ ApplicationManagerTest#testNonExistingApp(49f6e7a06ebc5aa8).(); |
| 47 | void testApplicationInfo_datacxx . . $ ApplicationManagerTest#testApplicationInfo_data(49f6e7a06ebc5aa8).(); |
| 48 | void testApplicationInfocxx . . $ ApplicationManagerTest#testApplicationInfo(49f6e7a06ebc5aa8).(); |
| 49 | void testAclAdd_datacxx . . $ ApplicationManagerTest#testAclAdd_data(49f6e7a06ebc5aa8).(); |
| 50 | void testAclAddcxx . . $ ApplicationManagerTest#testAclAdd(49f6e7a06ebc5aa8).(); |
| 51 | void testAclRemove_datacxx . . $ ApplicationManagerTest#testAclRemove_data(49f6e7a06ebc5aa8).(); |
| 52 | void testAclRemovecxx . . $ ApplicationManagerTest#testAclRemove(49f6e7a06ebc5aa8).(); |
| 53 | void testApplicationFromProfile_datacxx . . $ ApplicationManagerTest#testApplicationFromProfile_data(49f6e7a06ebc5aa8).(); |
| 54 | void testApplicationFromProfilecxx . . $ ApplicationManagerTest#testApplicationFromProfile(49f6e7a06ebc5aa8).(); |
| 55 | void testProviderInfo_datacxx . . $ ApplicationManagerTest#testProviderInfo_data(49f6e7a06ebc5aa8).(); |
| 56 | void testProviderInfocxx . . $ ApplicationManagerTest#testProviderInfo(49f6e7a06ebc5aa8).(); |
| 57 | void testUsefulProviders_datacxx . . $ ApplicationManagerTest#testUsefulProviders_data(49f6e7a06ebc5aa8).(); |
| 58 | void testUsefulProviderscxx . . $ ApplicationManagerTest#testUsefulProviders(49f6e7a06ebc5aa8).(); |
| 59 | |
| 60 | private: |
| 61 | void clearApplicationsDircxx . . $ ApplicationManagerTest#clearApplicationsDir(49f6e7a06ebc5aa8).(); |
| 62 | void clearProvidersDircxx . . $ ApplicationManagerTest#clearProvidersDir(49f6e7a06ebc5aa8).(); |
| 63 | void clearTestDircxx . . $ ApplicationManagerTest#clearTestDir(49f6e7a06ebc5aa8).(); |
| 64 | void writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).(const QStringcxx . . $ QString# &name, const QStringcxx . . $ QString# &contents); |
| 65 | |
| 66 | private: |
| 67 | QDircxx . . $ QDir# m_testDircxx . . $ ApplicationManagerTest#m_testDir.; |
| 68 | QDircxx . . $ QDir# m_accountsDircxx . . $ ApplicationManagerTest#m_accountsDir.; |
| 69 | }; |
| 70 | |
| 71 | ApplicationManagerTestcxx . . $ ApplicationManagerTest#::ApplicationManagerTestcxx . . $ ApplicationManagerTest#ApplicationManagerTest(49f6e7a06ebc5aa8).(): |
| 72 | QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(0), |
| 73 | m_testDircxx . . $ ApplicationManagerTest#m_testDir.(TEST_DIRcxx . . $ `tests/online-accounts-plugins/lib/tst_application_manager.cpp:33:9`!), |
| 74 | m_accountsDircxx . . $ ApplicationManagerTest#m_accountsDir.(TEST_DIRcxx . . $ `tests/online-accounts-plugins/lib/tst_application_manager.cpp:33:9`! "/accounts") |
| 75 | { |
| 76 | } |
| 77 | |
| 78 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::clearApplicationsDircxx . . $ ApplicationManagerTest#clearApplicationsDir(49f6e7a06ebc5aa8).() |
| 79 | { |
| 80 | QDircxx . . $ QDir# applicationsDir = m_accountsDircxx . . $ QDir#QDir(601f444709e147bb).; |
| 81 | if (applicationsDir.cdcxx . . $ QDir#cd(e1defb592416720d).("applications"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 82 | applicationsDir.removeRecursivelycxx . . $ QDir#removeRecursively(c9857a73d68e59ba).(); |
| 83 | applicationsDir.mkpathcxx . . $ QDir#mkpath(f3b39adf77d9c36c).("."cxx . . $ QString#QString(85c52e162fed56f9).); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::clearProvidersDircxx . . $ ApplicationManagerTest#clearProvidersDir(49f6e7a06ebc5aa8).() |
| 88 | { |
| 89 | QDircxx . . $ QDir# providersDir = m_accountsDircxx . . $ QDir#QDir(601f444709e147bb).; |
| 90 | if (providersDir.cdcxx . . $ QDir#cd(e1defb592416720d).("providers"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 91 | providersDir.removeRecursivelycxx . . $ QDir#removeRecursively(c9857a73d68e59ba).(); |
| 92 | providersDir.mkpathcxx . . $ QDir#mkpath(f3b39adf77d9c36c).("."cxx . . $ QString#QString(85c52e162fed56f9).); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::clearTestDircxx . . $ ApplicationManagerTest#clearTestDir(49f6e7a06ebc5aa8).() |
| 97 | { |
| 98 | m_testDircxx . . $ ApplicationManagerTest#m_testDir..removeRecursivelycxx . . $ QDir#removeRecursively(c9857a73d68e59ba).(); |
| 99 | m_testDircxx . . $ ApplicationManagerTest#m_testDir..mkpathcxx . . $ QDir#mkpath(f3b39adf77d9c36c).("."cxx . . $ QString#QString(85c52e162fed56f9).); |
| 100 | } |
| 101 | |
| 102 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).(const QStringcxx . . $ QString# &name, |
| 103 | const QStringcxx . . $ QString# &contents) |
| 104 | { |
| 105 | /* Create files into the appropriate directory: |
| 106 | * .provider files go in "providers", .application in "applications" and so |
| 107 | * on: so we just need to take the file extension and add one "s". |
| 108 | */ |
| 109 | QFileInfocxx . . $ QFileInfo# fileInfocxx . . $ QFileInfo#QFileInfo(3520e46b33348bf6).(name); |
| 110 | QStringcxx . . $ QString# subDirName = fileInfo.suffixcxx . . $ QFileInfo#suffix(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "s"; |
| 111 | m_accountsDircxx . . $ ApplicationManagerTest#m_accountsDir..mkpathcxx . . $ QDir#mkpath(f3b39adf77d9c36c).(subDirName); |
| 112 | QDircxx . . $ QDir# subDir = m_accountsDircxx . . $ QDir#QDir(601f444709e147bb).; |
| 113 | subDir.cdcxx . . $ QDir#cd(e1defb592416720d).(subDirName); |
| 114 | |
| 115 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(subDir.filePathcxx . . $ QDir#filePath(5555d9024dcf93fb).(name)); |
| 116 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::WriteOnlycxx . . $ QIODevice#WriteOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) { |
| 117 | qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Could not write file" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). name; |
| 118 | return; |
| 119 | } |
| 120 | |
| 121 | file.writecxx . . $ QIODevice#write(4ee2750a0be83987).(contents.toUtf8cxx . . $ QString#toUtf8(ef52b713090bc85a).()); |
| 122 | } |
| 123 | |
| 124 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::initTestCasecxx . . $ ApplicationManagerTest#initTestCase(49f6e7a06ebc5aa8).() |
| 125 | { |
| 126 | qputenvcxx . . $ qputenv(d42e8231112a1b5b).("ACCOUNTS", TEST_DIRcxx . . $ `tests/online-accounts-plugins/lib/tst_application_manager.cpp:33:9`!); |
| 127 | qputenvcxx . . $ qputenv(d42e8231112a1b5b).("XDG_DATA_HOME", TEST_DIRcxx . . $ `tests/online-accounts-plugins/lib/tst_application_manager.cpp:33:9`!); |
| 128 | qputenvcxx . . $ qputenv(d42e8231112a1b5b).("XDG_DATA_DIRS", TEST_DIRcxx . . $ `tests/online-accounts-plugins/lib/tst_application_manager.cpp:33:9`!); |
| 129 | |
| 130 | clearTestDircxx . . $ ApplicationManagerTest#clearTestDir(49f6e7a06ebc5aa8).(); |
| 131 | |
| 132 | /* Create a few service files */ |
| 133 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("cool-mail.service"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 134 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 135 | "<service id=\"cool-mail\">\n" |
| 136 | " <type>tstemail</type>\n" |
| 137 | " <name>Cool Mail</name>\n" |
| 138 | " <provider>cool</provider>\n" |
| 139 | "</service>"); |
| 140 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("cool-sharing.service"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 141 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 142 | "<service id=\"cool-sharing\">\n" |
| 143 | " <type>tstsharing</type>\n" |
| 144 | " <name>Cool Sharing</name>\n" |
| 145 | " <provider>cool</provider>\n" |
| 146 | "</service>"); |
| 147 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("bad-mail.service"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 148 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 149 | "<service id=\"bad-mail\">\n" |
| 150 | " <type>tstemail</type>\n" |
| 151 | " <name>Bad Mail</name>\n" |
| 152 | " <provider>bad</provider>\n" |
| 153 | "</service>"); |
| 154 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("bad-sharing.service"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 155 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 156 | "<service id=\"bad-sharing\">\n" |
| 157 | " <type>tstsharing</type>\n" |
| 158 | " <name>Bad Sharing</name>\n" |
| 159 | " <provider>bad</provider>\n" |
| 160 | "</service>"); |
| 161 | |
| 162 | /* And the relative providers */ |
| 163 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("cool.provider"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 164 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 165 | "<provider id=\"cool\">\n" |
| 166 | " <name>Cool provider</name>\n" |
| 167 | "</provider>"); |
| 168 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("bad.provider"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 169 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 170 | "<provider id=\"bad\">\n" |
| 171 | " <name>Bad provider</name>\n" |
| 172 | "</provider>"); |
| 173 | } |
| 174 | |
| 175 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testNonExistingAppcxx . . $ ApplicationManagerTest#testNonExistingApp(49f6e7a06ebc5aa8).() |
| 176 | { |
| 177 | ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# managercxx . . $ OnlineAccountsUi/ApplicationManager#ApplicationManager(749de1b6ae65bddd).; |
| 178 | |
| 179 | QVariantMapcxx . . $ QVariantMap# info = manager.applicationInfocxx . . $ OnlineAccountsUi/ApplicationManager#applicationInfo(d822f47b982b0b13).("com.lomiri.test_MyApp"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 180 | "com.lomiri.test_MyApp_0.1"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 181 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(info.isEmpty()); |
| 182 | |
| 183 | QStringListcxx . . $ QStringList# aclcxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 184 | acl <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "one"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "two"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 185 | QStringListcxx . . $ QStringList# newAcl = manager.addApplicationToAclcxx . . $ OnlineAccountsUi/ApplicationManager#addApplicationToAcl(75f30ff5959b637d).(acl, "com.lomiri.test_MyApp"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 186 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(newAcl, acl); |
| 187 | |
| 188 | newAcl =cxx . . $ QStringList#`operator=`(335bb966c1744308). manager.removeApplicationFromAclcxx . . $ OnlineAccountsUi/ApplicationManager#removeApplicationFromAcl(75f30ff5959b637d).(acl, "com.lomiri.test_MyApp"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 189 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(newAcl, acl); |
| 190 | } |
| 191 | |
| 192 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testApplicationInfo_datacxx . . $ ApplicationManagerTest#testApplicationInfo_data(49f6e7a06ebc5aa8).() |
| 193 | { |
| 194 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("applicationId"); |
| 195 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("contents"); |
| 196 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("inputProfile"); |
| 197 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("expectedProfile"); |
| 198 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringListcxx . . $ QStringList#>("services"); |
| 199 | |
| 200 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("no-services") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 201 | "com.lomiri.test_MyApp" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 202 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 203 | "<application id=\"com.lomiri.test_MyApp\">\n" |
| 204 | " <description>My application</description>\n" |
| 205 | " <profile>com.lomiri.test_MyApp_0.2</profile>\n" |
| 206 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 207 | "com.lomiri.test_MyApp_0.2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 208 | "com.lomiri.test_MyApp_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 209 | QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).(); |
| 210 | |
| 211 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("no-valid-services") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 212 | "com.lomiri.test_MyApp2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 213 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 214 | "<application id=\"com.lomiri.test_MyApp2\">\n" |
| 215 | " <description>My application 2</description>\n" |
| 216 | " <service-types>\n" |
| 217 | " <service-type id=\"some type\">Do something</service-type>\n" |
| 218 | " </service-types>\n" |
| 219 | " <profile>com.lomiri.test_MyApp2_0.2</profile>\n" |
| 220 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 221 | "com.lomiri.test_MyApp2_0.2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 222 | "com.lomiri.test_MyApp2_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 223 | QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).(); |
| 224 | |
| 225 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("email-services") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 226 | "com.lomiri.test_MyApp3" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 227 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 228 | "<application id=\"com.lomiri.test_MyApp3\">\n" |
| 229 | " <description>My application 3</description>\n" |
| 230 | " <service-types>\n" |
| 231 | " <service-type id=\"tstemail\">\n" |
| 232 | " <description>Send email</description>\n" |
| 233 | " </service-type>\n" |
| 234 | " </service-types>\n" |
| 235 | " <profile>com.lomiri.test_MyApp3_0.2</profile>\n" |
| 236 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 237 | "com.lomiri.test_MyApp3_0.2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 238 | "com.lomiri.test_MyApp3_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 239 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "cool-mail"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "bad-mail"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 240 | |
| 241 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("cool-services") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 242 | "com.lomiri.test_MyApp4" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 243 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 244 | "<application id=\"com.lomiri.test_MyApp4\">\n" |
| 245 | " <description>My application 4</description>\n" |
| 246 | " <services>\n" |
| 247 | " <service id=\"cool-mail\">\n" |
| 248 | " <description>Send email</description>\n" |
| 249 | " </service>\n" |
| 250 | " <service id=\"cool-sharing\">\n" |
| 251 | " <description>Share stuff</description>\n" |
| 252 | " </service>\n" |
| 253 | " </services>\n" |
| 254 | " <profile>com.lomiri.test_MyApp4_0.2</profile>\n" |
| 255 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 256 | "com.lomiri.test_MyApp4_0.2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 257 | "com.lomiri.test_MyApp4_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 258 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "cool-mail"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "cool-sharing"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 259 | |
| 260 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("unconfined app") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 261 | "com.lomiri.test_UnconfinedApp" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 262 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 263 | "<application id=\"com.lomiri.test_UnconfinedApp\">\n" |
| 264 | " <description>My application 5</description>\n" |
| 265 | " <services>\n" |
| 266 | " <service id=\"cool-mail\">\n" |
| 267 | " <description>Send email</description>\n" |
| 268 | " </service>\n" |
| 269 | " </services>\n" |
| 270 | " <profile>com.lomiri.test_UnconfinedApp_0.2</profile>\n" |
| 271 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 272 | "unconfined" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 273 | "com.lomiri.test_UnconfinedApp_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 274 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "cool-mail"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 275 | |
| 276 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("unconfined app, no profile") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 277 | "com.lomiri.test_UnconfinedApp2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 278 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 279 | "<application id=\"com.lomiri.test_UnconfinedApp2\">\n" |
| 280 | " <description>My application 6</description>\n" |
| 281 | " <services>\n" |
| 282 | " <service id=\"cool-mail\">\n" |
| 283 | " <description>Send email</description>\n" |
| 284 | " </service>\n" |
| 285 | " </services>\n" |
| 286 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 287 | "unconfined" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 288 | "unconfined" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 289 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "cool-mail"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 290 | } |
| 291 | |
| 292 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testApplicationInfocxx . . $ ApplicationManagerTest#testApplicationInfo(49f6e7a06ebc5aa8).() |
| 293 | { |
| 294 | clearApplicationsDircxx . . $ ApplicationManagerTest#clearApplicationsDir(49f6e7a06ebc5aa8).(); |
| 295 | |
| 296 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, applicationId); |
| 297 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, contents); |
| 298 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, inputProfile); |
| 299 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, expectedProfile); |
| 300 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QStringList, services); |
| 301 | |
| 302 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).(applicationId +cxx . . $ operator+(3d22f08efddf8107). ".application", contents); |
| 303 | |
| 304 | ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# managercxx . . $ OnlineAccountsUi/ApplicationManager#ApplicationManager(749de1b6ae65bddd).; |
| 305 | |
| 306 | QVariantMapcxx . . $ QVariantMap# info = manager.applicationInfocxx . . $ OnlineAccountsUi/ApplicationManager#applicationInfo(d822f47b982b0b13).(applicationId, inputProfile); |
| 307 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(info.value("id").toString(), applicationId); |
| 308 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(info.value("profile").toString(), expectedProfile); |
| 309 | QStringListcxx . . $ QStringList# info_services = info.valuecxx . . $ QMap#value(866b0a4e5fb46e14).("services"cxx . . $ QString#QString(85c52e162fed56f9).).toStringListcxx . . $ QVariant#toStringList(e1dbd5c4feadc8f5).(); |
| 310 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(QSet<QString>(info_services.constBegin(), info_services.constEnd()), QSet<QString>(services.constBegin(), services.constEnd())); |
| 311 | } |
| 312 | |
| 313 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testAclAdd_datacxx . . $ ApplicationManagerTest#testAclAdd_data(49f6e7a06ebc5aa8).() |
| 314 | { |
| 315 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("applicationId"); |
| 316 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringListcxx . . $ QStringList#>("oldAcl"); |
| 317 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringListcxx . . $ QStringList#>("newAcl"); |
| 318 | |
| 319 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("add to empty") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 320 | "com.lomiri.test_One" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 321 | QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 322 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "com.lomiri.test_One_0.1"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 323 | |
| 324 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("add to one") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 325 | "com.lomiri.test_One" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 326 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9).) <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 327 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "com.lomiri.test_One_0.1"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 328 | |
| 329 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("add existing") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 330 | "com.lomiri.test_One" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 331 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "com.lomiri.test_One_0.1"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9).) <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 332 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "com.lomiri.test_One_0.1"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 333 | } |
| 334 | |
| 335 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testAclAddcxx . . $ ApplicationManagerTest#testAclAdd(49f6e7a06ebc5aa8).() |
| 336 | { |
| 337 | clearApplicationsDircxx . . $ ApplicationManagerTest#clearApplicationsDir(49f6e7a06ebc5aa8).(); |
| 338 | |
| 339 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("com.lomiri.test_One.application"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 340 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 341 | "<application id=\"com.lomiri.test_One\">\n" |
| 342 | " <description>My application</description>\n" |
| 343 | " <profile>com.lomiri.test_One_0.1</profile>\n" |
| 344 | "</application>"); |
| 345 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("com.lomiri.test_Two.application"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 346 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 347 | "<application id=\"com.lomiri.test_Two\">\n" |
| 348 | " <description>My application</description>\n" |
| 349 | " <profile>com.lomiri.test_Two_0.2</profile>\n" |
| 350 | "</application>"); |
| 351 | |
| 352 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, applicationId); |
| 353 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QStringList, oldAcl); |
| 354 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QStringList, newAcl); |
| 355 | |
| 356 | ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# managercxx . . $ OnlineAccountsUi/ApplicationManager#ApplicationManager(749de1b6ae65bddd).; |
| 357 | |
| 358 | QStringListcxx . . $ QStringList# acl = manager.addApplicationToAclcxx . . $ OnlineAccountsUi/ApplicationManager#addApplicationToAcl(75f30ff5959b637d).(oldAcl, applicationId); |
| 359 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(QSet<QString>(acl.constBegin(), acl.constEnd()), QSet<QString>(newAcl.constBegin(), newAcl.constEnd())); |
| 360 | } |
| 361 | |
| 362 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testAclRemove_datacxx . . $ ApplicationManagerTest#testAclRemove_data(49f6e7a06ebc5aa8).() |
| 363 | { |
| 364 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("applicationId"); |
| 365 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringListcxx . . $ QStringList#>("oldAcl"); |
| 366 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringListcxx . . $ QStringList#>("newAcl"); |
| 367 | |
| 368 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("remove from empty") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 369 | "com.lomiri.test_One" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 370 | QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 371 | QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).(); |
| 372 | |
| 373 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("remove from one") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 374 | "com.lomiri.test_One" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 375 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "com.lomiri.test_One_0.1"cxx . . $ QString#QString(85c52e162fed56f9).) <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 376 | QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).(); |
| 377 | |
| 378 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("remove from two") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 379 | "com.lomiri.test_One" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 380 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "com.lomiri.test_One_0.1"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9).) <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 381 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 382 | |
| 383 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("remove from missing") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 384 | "com.lomiri.test_One" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 385 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some other app"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9).) <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 386 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some other app"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 387 | |
| 388 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("remove multiple versions") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 389 | "com.lomiri.test_One" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 390 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some other app"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "com.lomiri.test_One_0.1"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 391 | "com.lomiri.test_One_0.3"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 392 | "com.lomiri.test_One_0.2"cxx . . $ QString#QString(85c52e162fed56f9).) <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 393 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some other app"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "some app"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 394 | } |
| 395 | |
| 396 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testAclRemovecxx . . $ ApplicationManagerTest#testAclRemove(49f6e7a06ebc5aa8).() |
| 397 | { |
| 398 | clearApplicationsDircxx . . $ ApplicationManagerTest#clearApplicationsDir(49f6e7a06ebc5aa8).(); |
| 399 | |
| 400 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("com.lomiri.test_One.application"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 401 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 402 | "<application id=\"com.lomiri.test_One\">\n" |
| 403 | " <description>My application</description>\n" |
| 404 | " <profile>com.lomiri.test_One_0.1</profile>\n" |
| 405 | "</application>"); |
| 406 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).("com.lomiri.test_Two.application"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 407 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 408 | "<application id=\"com.lomiri.test_Two\">\n" |
| 409 | " <description>My application</description>\n" |
| 410 | " <profile>com.lomiri.test_Two_0.2</profile>\n" |
| 411 | "</application>"); |
| 412 | |
| 413 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, applicationId); |
| 414 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QStringList, oldAcl); |
| 415 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QStringList, newAcl); |
| 416 | |
| 417 | ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# managercxx . . $ OnlineAccountsUi/ApplicationManager#ApplicationManager(749de1b6ae65bddd).; |
| 418 | |
| 419 | QStringListcxx . . $ QStringList# acl = manager.removeApplicationFromAclcxx . . $ OnlineAccountsUi/ApplicationManager#removeApplicationFromAcl(75f30ff5959b637d).(oldAcl, applicationId); |
| 420 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(QSet<QString>(acl.constBegin(), acl.constEnd()), QSet<QString>(newAcl.constBegin(), newAcl.constEnd())); |
| 421 | } |
| 422 | |
| 423 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testApplicationFromProfile_datacxx . . $ ApplicationManagerTest#testApplicationFromProfile_data(49f6e7a06ebc5aa8).() |
| 424 | { |
| 425 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("applicationId"); |
| 426 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("contents"); |
| 427 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("profile"); |
| 428 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<bool>("isValid"); |
| 429 | |
| 430 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("id-same-as-profile") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 431 | "com.lomiri.test_MyApp_0.2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 432 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 433 | "<application id=\"com.lomiri.test_MyApp\">\n" |
| 434 | " <description>My application</description>\n" |
| 435 | " <profile>com.lomiri.test_MyApp_0.2</profile>\n" |
| 436 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 437 | "com.lomiri.test_MyApp_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 438 | true; |
| 439 | |
| 440 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("id-with-no-version") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 441 | "com.lomiri.test_MyApp2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 442 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 443 | "<application id=\"com.lomiri.test_MyApp2\">\n" |
| 444 | " <description>My application 2</description>\n" |
| 445 | " <profile>com.lomiri.test_MyApp2_0.2</profile>\n" |
| 446 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 447 | "com.lomiri.test_MyApp2_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 448 | true; |
| 449 | |
| 450 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("id-is-just-package") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 451 | "com.lomiri.test" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 452 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 453 | "<application id=\"com.lomiri.test_MyApp3\">\n" |
| 454 | " <description>My application 3</description>\n" |
| 455 | " <profile>com.lomiri.test_MyApp3_0.2</profile>\n" |
| 456 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 457 | "com.lomiri.test_MyApp3_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 458 | true; |
| 459 | |
| 460 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("not found") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 461 | "com.lomiri.test_MyApp5" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 462 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 463 | "<application id=\"com.lomiri.test_MyApp4\">\n" |
| 464 | " <description>My application 4</description>\n" |
| 465 | " <profile>com.lomiri.test_MyApp4_0.2</profile>\n" |
| 466 | "</application>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 467 | "com.lomiri.test_MyApp4_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 468 | false; |
| 469 | } |
| 470 | |
| 471 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testApplicationFromProfilecxx . . $ ApplicationManagerTest#testApplicationFromProfile(49f6e7a06ebc5aa8).() |
| 472 | { |
| 473 | clearApplicationsDircxx . . $ ApplicationManagerTest#clearApplicationsDir(49f6e7a06ebc5aa8).(); |
| 474 | |
| 475 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, applicationId); |
| 476 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, contents); |
| 477 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, profile); |
| 478 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(bool, isValid); |
| 479 | |
| 480 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).(applicationId +cxx . . $ operator+(3d22f08efddf8107). ".application", contents); |
| 481 | |
| 482 | ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# managercxx . . $ OnlineAccountsUi/ApplicationManager#ApplicationManager(749de1b6ae65bddd).; |
| 483 | |
| 484 | Accountscxx . . $ Accounts/::Applicationcxx . . $ Accounts/Application# app = manager.applicationFromProfilecxx . . $ OnlineAccountsUi/ApplicationManager#applicationFromProfile(2395a26dc7c1e889).(profile); |
| 485 | if (!isValid) { |
| 486 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(!app.isValid()); |
| 487 | } else { |
| 488 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(app.isValid()); |
| 489 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(app.name(), applicationId); |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testProviderInfo_datacxx . . $ ApplicationManagerTest#testProviderInfo_data(49f6e7a06ebc5aa8).() |
| 494 | { |
| 495 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("providerId"); |
| 496 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("contents"); |
| 497 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("profile"); |
| 498 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringcxx . . $ QString#>("packageDir"); |
| 499 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<bool>("isSingleAccount"); |
| 500 | |
| 501 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("no profile") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 502 | "com.lomiri.test_MyPlugin" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 503 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 504 | "<provider id=\"com.lomiri.test_MyPlugin\">\n" |
| 505 | " <name>My Plugin</name>\n" |
| 506 | "</provider>" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 507 | QStringcxx . . $ QString#QString(ced63f7c635d850d).() <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 508 | QStringcxx . . $ QString#QString(ced63f7c635d850d).() <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 509 | false; |
| 510 | |
| 511 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("single account") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 512 | "com.lomiri.test_MyPlugin" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 513 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 514 | "<provider id=\"com.lomiri.test_MyPlugin\">\n" |
| 515 | " <name>My Plugin</name>\n" |
| 516 | " <single-account>true</single-account>\n" |
| 517 | "</provider>" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 518 | QStringcxx . . $ QString#QString(ced63f7c635d850d).() <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 519 | QStringcxx . . $ QString#QString(ced63f7c635d850d).() <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 520 | true; |
| 521 | |
| 522 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("no package-dir") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 523 | "com.lomiri.test_MyPlugin2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 524 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 525 | "<provider id=\"com.lomiri.test_MyPlugin2\">\n" |
| 526 | " <name>My Plugin</name>\n" |
| 527 | " <profile>com.lomiri.test_MyPlugin2_0.2</profile>\n" |
| 528 | " <single-account>false</single-account>\n" |
| 529 | "</provider>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 530 | "com.lomiri.test_MyPlugin2_0.2" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 531 | QStringcxx . . $ QString#QString(ced63f7c635d850d).() <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 532 | false; |
| 533 | |
| 534 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("with package-dir") <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 535 | "com.lomiri.test_MyPlugin3" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 536 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" |
| 537 | "<provider id=\"com.lomiri.test_MyPlugin3\">\n" |
| 538 | " <name>My Plugin</name>\n" |
| 539 | " <profile>com.lomiri.test_MyPlugin3_0.2</profile>\n" |
| 540 | " <package-dir>/opt/click.ubuntu.com/something</package-dir>\n" |
| 541 | "</provider>" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 542 | "com.lomiri.test_MyPlugin3_0.2" <<cxx . . $ `operator<<`(1c43a92f59c6a770). |
| 543 | "/opt/click.ubuntu.com/something" <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 544 | false; |
| 545 | } |
| 546 | |
| 547 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testProviderInfocxx . . $ ApplicationManagerTest#testProviderInfo(49f6e7a06ebc5aa8).() |
| 548 | { |
| 549 | clearProvidersDircxx . . $ ApplicationManagerTest#clearProvidersDir(49f6e7a06ebc5aa8).(); |
| 550 | |
| 551 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, providerId); |
| 552 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, contents); |
| 553 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, profile); |
| 554 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QString, packageDir); |
| 555 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(bool, isSingleAccount); |
| 556 | |
| 557 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).(providerId +cxx . . $ operator+(3d22f08efddf8107). ".provider", contents); |
| 558 | |
| 559 | ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# managercxx . . $ OnlineAccountsUi/ApplicationManager#ApplicationManager(749de1b6ae65bddd).; |
| 560 | |
| 561 | QVariantMapcxx . . $ QVariantMap# info = manager.providerInfocxx . . $ OnlineAccountsUi/ApplicationManager#providerInfo(b5169218cdb2f965).(providerId); |
| 562 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(info.value("id").toString(), providerId); |
| 563 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(info.value("profile").toString(), profile); |
| 564 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(info.value("package-dir").toString(), packageDir); |
| 565 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(info.value("isSingleAccount").toBool(), isSingleAccount); |
| 566 | } |
| 567 | |
| 568 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testUsefulProviders_datacxx . . $ ApplicationManagerTest#testUsefulProviders_data(49f6e7a06ebc5aa8).() |
| 569 | { |
| 570 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringListcxx . . $ QStringList#>("applicationIds"); |
| 571 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringListcxx . . $ QStringList#>("contents"); |
| 572 | QTestcxx . . $ QTest/::addColumncxx . . $ QTest/addColumn(cfe4d590606f2f46).<QStringListcxx . . $ QStringList#>("expectedProviders"); |
| 573 | |
| 574 | QStringListcxx . . $ QStringList# applicationIdscxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 575 | QStringListcxx . . $ QStringList# contentscxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 576 | applicationIds <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "com.lomiri.test_MyApp"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 577 | contents <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 578 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 579 | "<application id=\"com.lomiri.test_MyApp\">\n" |
| 580 | " <description>My application</description>\n" |
| 581 | "</application>"; |
| 582 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("no-services") <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 583 | applicationIds <<cxx . . $ `operator<<`(61fb880f51a53ddf). contents <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 584 | QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).(); |
| 585 | applicationIds.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 586 | contents.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 587 | |
| 588 | applicationIds <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 589 | "com.lomiri.test_MyApp2"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 590 | contents <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 591 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 592 | "<application id=\"com.lomiri.test_MyApp2\">\n" |
| 593 | " <description>My application 2</description>\n" |
| 594 | " <service-types>\n" |
| 595 | " <service-type id=\"some type\">Do something</service-type>\n" |
| 596 | " </service-types>\n" |
| 597 | "</application>"; |
| 598 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("no-valid-services") <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 599 | applicationIds <<cxx . . $ `operator<<`(61fb880f51a53ddf). contents <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 600 | QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).(); |
| 601 | applicationIds.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 602 | contents.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 603 | |
| 604 | applicationIds <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 605 | "com.lomiri.test_MyApp3"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 606 | contents <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 607 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 608 | "<application id=\"com.lomiri.test_MyApp3\">\n" |
| 609 | " <description>My application 3</description>\n" |
| 610 | " <service-types>\n" |
| 611 | " <service-type id=\"tstemail\">\n" |
| 612 | " <description>Send email</description>\n" |
| 613 | " </service-type>\n" |
| 614 | " </service-types>\n" |
| 615 | "</application>"; |
| 616 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("email-services") <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 617 | applicationIds <<cxx . . $ `operator<<`(61fb880f51a53ddf). contents <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 618 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "cool"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "bad"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 619 | applicationIds.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 620 | contents.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 621 | |
| 622 | applicationIds <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 623 | "com.lomiri.test_MyApp4"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 624 | contents <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 625 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 626 | "<application id=\"com.lomiri.test_MyApp4\">\n" |
| 627 | " <description>My application 4</description>\n" |
| 628 | " <services>\n" |
| 629 | " <service id=\"cool-mail\">\n" |
| 630 | " <description>Send email</description>\n" |
| 631 | " </service>\n" |
| 632 | " <service id=\"cool-sharing\">\n" |
| 633 | " <description>Share stuff</description>\n" |
| 634 | " </service>\n" |
| 635 | " </services>\n" |
| 636 | "</application>"; |
| 637 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("cool-services") <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 638 | applicationIds <<cxx . . $ `operator<<`(61fb880f51a53ddf). contents <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 639 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "cool"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 640 | applicationIds.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 641 | contents.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 642 | |
| 643 | applicationIds <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 644 | "com.lomiri.test_MyApp5"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 645 | "com.lomiri.test_MyApp6"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 646 | contents <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 647 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 648 | "<application id=\"com.lomiri.test_MyApp5\">\n" |
| 649 | " <description>My application 5</description>\n" |
| 650 | " <services>\n" |
| 651 | " <service id=\"cool-mail\">\n" |
| 652 | " <description>Send email</description>\n" |
| 653 | " </service>\n" |
| 654 | " </services>\n" |
| 655 | "</application>" <<cxx . . $ QStringList#`operator<<`(85116071a693d053). |
| 656 | "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"cxx . . $ QString#QString(85c52e162fed56f9). |
| 657 | "<application id=\"com.lomiri.test_MyApp6\">\n" |
| 658 | " <description>My application 6</description>\n" |
| 659 | " <services>\n" |
| 660 | " <service id=\"bad-sharing\">\n" |
| 661 | " <description>Share stuff</description>\n" |
| 662 | " </service>\n" |
| 663 | " </services>\n" |
| 664 | "</application>"; |
| 665 | QTestcxx . . $ QTest/::newRowcxx . . $ QTest/newRow(71534bb7a360de38).("two apps") <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 666 | applicationIds <<cxx . . $ `operator<<`(61fb880f51a53ddf). contents <<cxx . . $ `operator<<`(61fb880f51a53ddf). |
| 667 | (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "cool"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "bad"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 668 | applicationIds.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 669 | contents.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 670 | } |
| 671 | |
| 672 | void ApplicationManagerTestcxx . . $ ApplicationManagerTest#::testUsefulProviderscxx . . $ ApplicationManagerTest#testUsefulProviders(49f6e7a06ebc5aa8).() |
| 673 | { |
| 674 | clearApplicationsDircxx . . $ ApplicationManagerTest#clearApplicationsDir(49f6e7a06ebc5aa8).(); |
| 675 | |
| 676 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QStringList, applicationIds); |
| 677 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QStringList, contents); |
| 678 | QFETCHcxx . . $ `<external>/8602788698586413231/qtestcase.h:201:9`!(QStringList, expectedProviders); |
| 679 | |
| 680 | for (int i = 0; i < applicationIds.countcxx . . $ QList#count(455f465bc33b4cdf).(); i++) { |
| 681 | writeAccountsFilecxx . . $ ApplicationManagerTest#writeAccountsFile(c1427772cd1877b0).(applicationIds[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i] +cxx . . $ operator+(3d22f08efddf8107). ".application", contents[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i]); |
| 682 | } |
| 683 | |
| 684 | ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# managercxx . . $ OnlineAccountsUi/ApplicationManager#ApplicationManager(749de1b6ae65bddd).; |
| 685 | |
| 686 | QStringListcxx . . $ QStringList# providers = manager.usefulProviderscxx . . $ OnlineAccountsUi/ApplicationManager#usefulProviders(e1dbd5c4feadc8f5).(); |
| 687 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(QSet<QString>(providers.constBegin(), providers.constEnd()), QSet<QString>(expectedProviders.constBegin(), expectedProviders.constEnd())); |
| 688 | } |
| 689 | |
| 690 | QTEST_GUILESS_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:514:9`!(ApplicationManagerTest); |
| 691 | |
| 692 | #include "tst_application_manager.moc"cxx . . $ `<file>/build/tests/online-accounts-plugins/lib/tst_application_manager_autogen/include/tst_application_manager.moc`/ |