tests/auto/qdesktopservices/tst_qdesktopservices.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    68     void openHttpUrl();
    68     void openHttpUrl();
    69     void openMailtoUrl_data();
    69     void openMailtoUrl_data();
    70     void openMailtoUrl();
    70     void openMailtoUrl();
    71     void openFileUrl_data();
    71     void openFileUrl_data();
    72     void openFileUrl();
    72     void openFileUrl();
       
    73     void openMultipleFileUrls();
    73 #endif
    74 #endif
    74     void handlers();
    75     void handlers();
    75     void storageLocation_data();
    76     void storageLocation_data();
    76     void storageLocation();
    77     void storageLocation();
    77 
    78 
   195 #endif
   196 #endif
   196 
   197 
   197     QFETCH(QUrl, url);
   198     QFETCH(QUrl, url);
   198     QFETCH(bool, result);
   199     QFETCH(bool, result);
   199     QCOMPARE(QDesktopServices::openUrl(url), result);
   200     QCOMPARE(QDesktopServices::openUrl(url), result);
       
   201     QTest::qWait(5000);
   200 }
   202 }
   201 
   203 
   202 void tst_qdesktopservices::openFileUrl_data()
   204 void tst_qdesktopservices::openFileUrl_data()
   203 {
   205 {
   204     QTest::addColumn<QUrl>("url");
   206     QTest::addColumn<QUrl>("url");
   237 #endif
   239 #endif
   238 
   240 
   239     QFETCH(QUrl, url);
   241     QFETCH(QUrl, url);
   240     QFETCH(bool, result);
   242     QFETCH(bool, result);
   241     QCOMPARE(QDesktopServices::openUrl(url), result);
   243     QCOMPARE(QDesktopServices::openUrl(url), result);
   242     QTest::qWait(15000);
   244     QTest::qWait(5000);
       
   245 }
       
   246 
       
   247 void tst_qdesktopservices::openMultipleFileUrls()
       
   248 {
       
   249 #ifndef RUN_MANUAL_TESTS
       
   250     QSKIP("Test disabled -- only for manual purposes", SkipAll);
       
   251 #endif
       
   252 
       
   253     QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/images/image.bmp")), true);
       
   254     QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/images/image.png")), true);
       
   255     QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/others/noendofline.txt")), true); 
       
   256     QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/installs/ErrRd.sisx")), true);      
   243 }
   257 }
   244 #endif
   258 #endif
   245 
   259 
   246 
   260 
   247 class MyUrlHandler : public QObject
   261 class MyUrlHandler : public QObject