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

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 Isolation test for ChromeOS. Created 6 years, 4 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
« no previous file with comments | « net/filter/mock_filter_context.h ('k') | net/filter/sdch_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ddf9fdc05fcbe5bd560cf3a31439fbfdf4a50748 100644
--- a/net/filter/mock_filter_context.cc
+++ b/net/filter/mock_filter_context.cc
@@ -12,12 +12,19 @@ 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;
+ request_time_ = base::Time();
+}
+
bool MockFilterContext::GetMimeType(std::string* mime_type) const {
*mime_type = mime_type_;
return true;
@@ -26,6 +33,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;
}
« no previous file with comments | « net/filter/mock_filter_context.h ('k') | net/filter/sdch_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698