SigningTS/client/signingcommoncase.h
changeset 41 b56d7e268634
parent 40 edc0144719a1
child 42 b9716e8867f1
equal deleted inserted replaced
40:edc0144719a1 41:b56d7e268634
     1 #ifndef SIGNINGCOMMONCASE_H
       
     2 #define SIGNINGCOMMONCASE_H
       
     3 
       
     4 #include <QObject>
       
     5 #include <QtCore/QUrl>
       
     6 
       
     7 #include <QtDebug>
       
     8 
       
     9 #include <QtNetwork/QNetworkAccessManager>
       
    10 #include <QtNetwork/QNetworkReply>
       
    11 #include <QtNetwork/QNetworkRequest>
       
    12 
       
    13 
       
    14 
       
    15 #include "test.h"
       
    16 
       
    17 /**
       
    18   This is the original puesdo-code for this test.
       
    19  This walks through signing.  Express and Certified signing are very similar.
       
    20 
       
    21  sign sis file with publisher ID
       
    22 
       
    23  type is one of express or certified.
       
    24 submissionID,type = uploadSIS(sisfile)
       
    25 
       
    26 createSigningRequest(submissionID, type, description)
       
    27 
       
    28 done = false
       
    29 do {
       
    30     status = getSubmissionStatus(submissionID)
       
    31     switch (status)
       
    32     {
       
    33         case SIGNED:
       
    34             done = true
       
    35             break;
       
    36         case SCAN_FAILED:
       
    37             done = true
       
    38             break;
       
    39         case TEST_FAILED:
       
    40             done = true
       
    41             break;
       
    42         case TESTING_IN_PROGRESS:
       
    43         case AUDIT_IN_PROGRESS:
       
    44             // This take awhile. Probably don't want to poll. IDEs may want to check for outstanding
       
    45             // submissions when IDE is started. see enumerateSubmissions
       
    46             break;
       
    47         default:
       
    48             sleep(2000);
       
    49     }
       
    50 
       
    51 } while (!done)
       
    52 
       
    53 if (status == SIGNED) getSubmission(submissionID)
       
    54   */
       
    55 
       
    56 class SigningCommonCase : public QObject, public TestInterface
       
    57 {
       
    58     Q_OBJECT
       
    59 public:
       
    60     explicit SigningCommonCase(QNetworkAccessManager &mgr, QObject *parent = 0);
       
    61 
       
    62     void run();
       
    63     TRESULT_STATE getResult();
       
    64 
       
    65 signals:
       
    66 
       
    67 public slots:
       
    68 
       
    69 
       
    70 private:
       
    71     void uploadSIS();
       
    72     QString testBaseURL;
       
    73     QNetworkAccessManager &mgr;
       
    74 };
       
    75 
       
    76 #endif // SIGNINGCOMMONCASE_H