46 } |
46 } |
47 |
47 |
48 |
48 |
49 void Test_XQApplicationManager::init() |
49 void Test_XQApplicationManager::init() |
50 { |
50 { |
|
51 testSharableFile = new XQSharableFile(); |
|
52 QVERIFY2(testSharableFile->open(testFileStr), mLog.join(endOfLine).toAscii()); |
51 mAppManager = new XQApplicationManager(); |
53 mAppManager = new XQApplicationManager(); |
52 QVERIFY2(mAppManager != NULL, mLog.join(endOfLine).toAscii()); |
54 QVERIFY2(mAppManager != NULL, mLog.join(endOfLine).toAscii()); |
53 QVERIFY2(mAppManager->lastError() == XQService::ENoError, mLog.join(endOfLine).toAscii()); |
55 QVERIFY2(mAppManager->lastError() == XQService::ENoError, mLog.join(endOfLine).toAscii()); |
54 } |
56 } |
55 |
57 |
56 void Test_XQApplicationManager::drm_file() |
58 void Test_XQApplicationManager::drm_file() |
57 { |
59 { |
58 mLog << "[QTH] [Test_XQApplicationManager] drm_file"; |
60 mLog << "[QTH] [Test_XQApplicationManager] drm_file"; |
59 |
61 |
|
62 #ifdef __WINS__ |
|
63 QSKIP("Checking drm attributes does not work correctly on emulator", SkipAll); |
|
64 #endif |
|
65 |
60 QStringList logmem = mLog; |
66 QStringList logmem = mLog; |
61 |
67 |
62 foreach (QString fileStr, testData.files.keys()) { |
68 foreach (QString fileStr, testData.files.keys()) { |
63 QFile file(fileStr); |
69 QFile file(fileStr); |
64 QVariantList drmValues; |
70 QVariantList drmValues; |
277 |
289 |
278 void Test_XQApplicationManager::list_sharablefile() |
290 void Test_XQApplicationManager::list_sharablefile() |
279 { |
291 { |
280 mLog << "[QTH] [Test_XQApplicationManager] list_sharablefile"; |
292 mLog << "[QTH] [Test_XQApplicationManager] list_sharablefile"; |
281 |
293 |
282 XQSharableFile testSharableFile; |
294 QSKIP("Currently function list(const XQSharableFile& file) returns maximum one interface", SkipAll); |
283 testSharableFile.open(testFileStr); |
295 |
284 |
296 QList<XQAiwInterfaceDescriptor> list = mAppManager->list(*testSharableFile); |
285 QList<XQAiwInterfaceDescriptor> list = mAppManager->list(testSharableFile); |
|
286 |
297 |
287 foreach (InterfaceData* interfaceData, testData.interfaces.values(IFileView)) { |
298 foreach (InterfaceData* interfaceData, testData.interfaces.values(IFileView)) { |
288 bool equal = false; |
299 bool equal = false; |
289 foreach (XQAiwInterfaceDescriptor interfaceDesc, list) { |
300 foreach (XQAiwInterfaceDescriptor interfaceDesc, list) { |
290 if (interfaceData->compare(interfaceDesc, mLog)) { |
301 if (interfaceData->compare(interfaceDesc, mLog)) { |
546 |
555 |
547 void Test_XQApplicationManager::create_sharablefile() |
556 void Test_XQApplicationManager::create_sharablefile() |
548 { |
557 { |
549 mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile"; |
558 mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile"; |
550 |
559 |
551 XQSharableFile testSharableFile; |
|
552 QVERIFY2(testSharableFile.open(testFileStr), mLog.join(endOfLine).toAscii()); |
|
553 |
|
554 { |
560 { |
555 XQAiwRequest* request = mAppManager->create(testSharableFile, true); |
561 XQAiwRequest* request = mAppManager->create(*testSharableFile, true); |
556 testRequest(request, QString(), QString(), true, true, &testSharableFile); |
562 testRequest(request, QString(), QString(), true, true, testSharableFile); |
557 delete request; |
563 delete request; |
558 } |
564 } |
559 |
565 |
560 { |
566 { |
561 XQAiwRequest* request = mAppManager->create(testSharableFile, false); |
567 XQAiwRequest* request = mAppManager->create(*testSharableFile, false); |
562 testRequest(request, QString(), testFileStr, false, true, &testSharableFile); |
568 testRequest(request, QString(), testFileStr, false, true, testSharableFile); |
563 delete request; |
569 delete request; |
564 } |
570 } |
565 |
571 |
566 QVERIFY2(mAppManager->lastError() == XQService::ENoError, mLog.join(endOfLine).toAscii()); |
572 QVERIFY2(mAppManager->lastError() == XQService::ENoError, mLog.join(endOfLine).toAscii()); |
567 |
573 |
568 testSharableFile.close(); |
|
569 |
|
570 mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile end"; |
574 mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile end"; |
571 } |
575 } |
572 |
576 |
573 void Test_XQApplicationManager::create_sharablefile_implementation() |
577 void Test_XQApplicationManager::create_sharablefile_implementation() |
574 { |
578 { |
575 mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile_implementation"; |
579 mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile_implementation"; |
576 |
580 |
577 XQSharableFile testSharableFile; |
581 QList<XQAiwInterfaceDescriptor> list = mAppManager->list(*testSharableFile); |
578 testSharableFile.open(testFileStr); |
|
579 QList<XQAiwInterfaceDescriptor> list = mAppManager->list(testSharableFile); |
|
580 QVERIFY2(list.count() > 0, mLog.join(endOfLine).toAscii()); |
582 QVERIFY2(list.count() > 0, mLog.join(endOfLine).toAscii()); |
581 |
583 |
582 foreach (XQAiwInterfaceDescriptor interfaceDesc, list) { |
584 foreach (XQAiwInterfaceDescriptor interfaceDesc, list) { |
583 foreach (InterfaceData* interfaceData, testData.interfaces.values(IFileView)) { |
585 foreach (InterfaceData* interfaceData, testData.interfaces.values(IFileView)) { |
584 if (interfaceData->compare(interfaceDesc, mLog)) { |
586 if (interfaceData->compare(interfaceDesc, mLog)) { |
585 { |
587 { |
586 XQAiwRequest* request = mAppManager->create(testSharableFile, interfaceDesc, true); |
588 XQAiwRequest* request = mAppManager->create(*testSharableFile, interfaceDesc, true); |
587 testRequest(request, QString(), testFileStr, true, true, &testSharableFile); |
589 testRequest(request, QString(), testFileStr, true, true, testSharableFile); |
588 delete request; |
590 delete request; |
589 } |
591 } |
590 |
592 |
591 { |
593 { |
592 XQAiwRequest* request = mAppManager->create(testSharableFile, interfaceDesc, false); |
594 XQAiwRequest* request = mAppManager->create(*testSharableFile, interfaceDesc, false); |
593 testRequest(request, QString(), testFileStr, false, true, &testSharableFile); |
595 testRequest(request, QString(), testFileStr, false, true, testSharableFile); |
594 delete request; |
596 delete request; |
595 } |
597 } |
596 } |
598 } |
597 } |
599 } |
598 |
600 |