Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(957)

Unified Diff: webkit/glue/media/buffered_resource_loader_unittest.cc

Issue 7044092: Not allow compression when requesting multimedia (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/glue/media/buffered_resource_loader_unittest.cc
===================================================================
--- webkit/glue/media/buffered_resource_loader_unittest.cc (revision 88518)
+++ webkit/glue/media/buffered_resource_loader_unittest.cc (working copy)
@@ -7,10 +7,12 @@
#include "base/format_macros.h"
#include "base/stringprintf.h"
#include "net/base/net_errors.h"
+#include "net/http/http_request_headers.h"
#include "net/http/http_util.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "webkit/glue/media/buffered_resource_loader.h"
@@ -30,6 +32,7 @@
using ::testing::ReturnRef;
using ::testing::SetArgumentPointee;
using ::testing::StrictMock;
+using ::testing::Truly;
using ::testing::NiceMock;
using ::testing::WithArgs;
@@ -65,6 +68,13 @@
loader->didFail(NULL, error);
}
+// Predicate that tests that request disallows compressed data.
+static bool CorrectAcceptEncoding(const WebKit::WebURLRequest &request) {
+ WebKit::WebString value = request.httpHeaderField(
+ WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding));
+ return value == WebString::fromUTF8("identity;q=1, *;q=0");
Alpha Left Google 2011/06/09 20:30:25 Check the exact string in the implementation is to
enal 2011/06/09 21:55:03 Done.
+}
+
class BufferedResourceLoaderTest : public testing::Test {
public:
BufferedResourceLoaderTest()
@@ -98,7 +108,8 @@
void Start() {
InSequence s;
- EXPECT_CALL(*url_loader_, loadAsynchronously(_, loader_.get()));
+ EXPECT_CALL(*url_loader_, loadAsynchronously(Truly(CorrectAcceptEncoding),
+ loader_.get()));
loader_->Start(
NewCallback(this, &BufferedResourceLoaderTest::StartCallback),
NewCallback(this, &BufferedResourceLoaderTest::NetworkCallback),
« net/url_request/url_request_http_job.cc ('K') | « webkit/glue/media/buffered_resource_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698