~mandel/ubuntu-download-manager/properties

« back to all changes in this revision

Viewing changes to tests/common/matchers.h

  • Committer: CI bot
  • Author(s): Manuel de la Peña
  • Date: 2014-07-21 09:39:39 UTC
  • mfrom: (304.2.8 write-upload-response)
  • Revision ID: ps-jenkins@lists.canonical.com-20140721093939-grgfcboq0ppb1dmz
On a succesful upload write the response to a secure local path for the client to read. 
Approved by: Sergio Schvezov, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
    }
102
102
}
103
103
 
 
104
MATCHER_P2(RequestHasHeaderWithValue, header, value, "Returns if the request does have a given value in a header.") {
 
105
    auto request = static_cast<QNetworkRequest>(arg);
 
106
    auto headerS = static_cast<QString>(header);
 
107
    auto valueS = static_cast<QString>(value);
 
108
    if (!request.hasRawHeader(headerS.toUtf8())) {
 
109
        return false;
 
110
    } else {
 
111
        return valueS.toUtf8() == request.rawHeader(headerS.toUtf8());
 
112
    }
 
113
}
 
114
 
104
115
MATCHER_P(StringListEq, value, "Returns if the string lists are eq.") {
105
116
    auto list = static_cast<QStringList>(arg);
106
117
    auto expectedList = static_cast<QStringList>(value);