Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/WebRequest.cpp

Issue 29377775: Issue 4916 - Request compression in CURL WebRequest. (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Issue 4916 - Request compression in CURL WebRequest. (updated test) Created March 2, 2017, 1:45 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/DefaultWebRequestCurl.cpp ('K') | « src/DefaultWebRequestCurl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/WebRequest.cpp
===================================================================
--- a/test/WebRequest.cpp
+++ b/test/WebRequest.cpp
@@ -84,16 +84,19 @@ TEST_F(DefaultWebRequestTest, RealWebReq
{
AdblockPlus::Sleep(200);
} while (jsEngine->Evaluate("this.foo")->IsUndefined());
ASSERT_EQ("text/plain", jsEngine->Evaluate("foo.responseHeaders['content-type'].substr(0, 10)")->AsString());
ASSERT_EQ(AdblockPlus::WebRequest::NS_OK, jsEngine->Evaluate("foo.status")->AsInt());
ASSERT_EQ(200, jsEngine->Evaluate("foo.responseStatus")->AsInt());
ASSERT_EQ("[Adblock Plus ", jsEngine->Evaluate("foo.responseText.substr(0, 14)")->AsString());
ASSERT_EQ("text/plain", jsEngine->Evaluate("foo.responseHeaders['content-type'].substr(0, 10)")->AsString());
+#if defined(HAVE_CURL)
+ ASSERT_EQ("gzip", jsEngine->Evaluate("foo.responseHeaders['content-encoding'].substr(0, 5)")->AsString());
Felix Dahlke 2017/03/02 14:33:39 Nit: Given how "gzip" is a four character string,
hub 2017/03/02 15:36:00 Acknowledged.
sergei 2017/03/02 21:05:26 Sorry, my bad, off by one error.
+#endif
ASSERT_TRUE(jsEngine->Evaluate("foo.responseHeaders['location']")->IsUndefined());
}
TEST_F(DefaultWebRequestTest, XMLHttpRequest)
{
AdblockPlus::FilterEngine filterEngine(jsEngine);
jsEngine->Evaluate("\
« src/DefaultWebRequestCurl.cpp ('K') | « src/DefaultWebRequestCurl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld