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

Unified Diff: chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc

Issue 13079008: Make use of network delegate explicit in drive unit tests using TestURLRequest. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Revert to NULL network delegate in request context, and explain why. Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc b/chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc
index fdb40f3a2b80564c6e18b3a55fab1ff0ec7201a1..1deb63ad59acb21c510b1cce5cd8d02859344494 100644
--- a/chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc
@@ -34,6 +34,16 @@ class DriveURLRequestJobTest : public testing::Test {
url_request_context_.reset(new net::TestURLRequestContext);
delegate_.reset(new net::TestDelegate);
network_delegate_.reset(new net::TestNetworkDelegate);
+
+ // TODO(tedv): Using the NetworkDelegate with the URLRequestContext
+ // with set_network_delegate() instead of a NULL delegate causes
+ // unit test failures, which should be fixed. This occurs because
+ // the TestNetworkDelegate generates a failure if an failed request
+ // is generated before the OnBeforeURLRequest() method is called,
+ // and DriveURLRequestJob::Start() does not call OnBeforeURLRequest().
+ // There is further discussion of this at:
+ // https://codereview.chromium.org/13079008/
+ //url_request_context_.set_network_delegate(network_delegate_.get());
}
MessageLoopForIO message_loop_;
@@ -47,7 +57,7 @@ class DriveURLRequestJobTest : public testing::Test {
TEST_F(DriveURLRequestJobTest, NonGetMethod) {
net::TestURLRequest request(
util::FilePathToDriveURL(base::FilePath::FromUTF8Unsafe("file")),
- delegate_.get(), url_request_context_.get());
+ delegate_.get(), url_request_context_.get(), NULL);
request.set_method("POST"); // Set non "GET" method.
scoped_refptr<DriveURLRequestJob> job(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698