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

Unified Diff: net/filter/mock_filter_context.cc

Issue 380003002: Improve testing for SDCH. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed braino: Added SDHC enable to the tests that need it. Created 6 years, 5 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: net/filter/mock_filter_context.cc
diff --git a/net/filter/mock_filter_context.cc b/net/filter/mock_filter_context.cc
index eb3484c19eb1eabcbc23a3d2df9e4ab47d8771ea..92c555743828c271354db4b5297547f99316689f 100644
--- a/net/filter/mock_filter_context.cc
+++ b/net/filter/mock_filter_context.cc
@@ -12,12 +12,18 @@ MockFilterContext::MockFilterContext()
: is_cached_content_(false),
is_download_(false),
is_sdch_response_(false),
+ ok_to_call_get_url_(true),
response_code_(-1),
context_(new URLRequestContext()) {
}
MockFilterContext::~MockFilterContext() {}
+void MockFilterContext::NukeUnstableInterfaces() {
+ context_.reset();
+ ok_to_call_get_url_ = false;
+}
+
bool MockFilterContext::GetMimeType(std::string* mime_type) const {
*mime_type = mime_type_;
return true;
@@ -26,6 +32,7 @@ bool MockFilterContext::GetMimeType(std::string* mime_type) const {
// What URL was used to access this data?
// Return false if gurl is not present.
bool MockFilterContext::GetURL(GURL* gurl) const {
+ DCHECK(ok_to_call_get_url_);
*gurl = gurl_;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698