diff options
author | Josh Bell <josh@lindenlab.com> | 2008-02-14 01:45:59 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2008-02-14 01:45:59 +0000 |
commit | 98fd90ddd6595f2ee7e626c14117f51def621ec5 (patch) | |
tree | 9a9caf8bffa53b753fe850f445bd133195e9bb03 /indra/test | |
parent | 89d938efe371645756240da72f4c359c36985060 (diff) |
svn merge -r 79730:79944 svn+ssh://svn.lindenlab.com/svn/linden/branches/parcel_media/sl-parcelmedia-6 --> release
QAR-275 Parcel Media
Sam made me do it.
Diffstat (limited to 'indra/test')
-rw-r--r-- | indra/test/llhttpclient_tut.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/indra/test/llhttpclient_tut.cpp b/indra/test/llhttpclient_tut.cpp index a4b2f45144..a177d5f2ea 100644 --- a/indra/test/llhttpclient_tut.cpp +++ b/indra/test/llhttpclient_tut.cpp @@ -116,7 +116,7 @@ namespace tut LLTimer timer; timer.setTimerExpirySec(timeout); - while(!mSawCompleted && !timer.hasExpired()) + while(!mSawCompleted && !mSawCompletedHeader && !timer.hasExpired()) { if (mServerPump) { @@ -167,13 +167,19 @@ namespace tut { return mResult; } + LLSD getHeader() + { + return mHeader; + } protected: bool mSawError; U32 mStatus; std::string mReason; bool mSawCompleted; + bool mSawCompletedHeader; LLSD mResult; + LLSD mHeader; bool mResultDeleted; class Result : public LLHTTPClient::Responder @@ -216,6 +222,14 @@ namespace tut mClient.mSawCompleted = true; } + virtual void completedHeader( + U32 status, const std::string& reason, + const LLSD& content) + { + mClient.mHeader = content; + mClient.mSawCompletedHeader = true; + } + private: HTTPClientTestData& mClient; }; @@ -228,7 +242,9 @@ namespace tut mSawError = false; mStatus = 0; mSawCompleted = false; + mSawCompletedHeader = false; mResult.clear(); + mHeader.clear(); mResultDeleted = false; return Result::build(*this); @@ -344,9 +360,19 @@ namespace tut LLSD body = result["body"]; ensure_equals("echoed result matches", body.size(), expected.size()); } - template<> template<> - void HTTPClientTestObject::test<8>() + void HTTPClientTestObject::test<8>() + { + // This is testing for the presence of the Header in the returned results + // from an HTTP::get call. + LLHTTPClient::get("http://www.secondlife.com/", newResult()); + runThePump(); + ensureStatusOK(); + LLSD header = getHeader(); + ensure_equals("got a header", header.emptyMap().asBoolean(), FALSE); + } + template<> template<> + void HTTPClientTestObject::test<9>() { LLHTTPClient::head("http://www.secondlife.com/", newResult()); runThePump(); |