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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 11490024: Avoid disk accesses on the wrong thread in URLRequestFileJob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/url_request/url_request_file_job.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 4ee326bf2eddd975296c53b8c1b429796ab29274..4e181c227524af6f1a13408511282b0ea48044bc 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -563,6 +563,24 @@ TEST_F(URLRequestTest, FileTest) {
}
}
+TEST_F(URLRequestTest, FileTestCancel) {
+ FilePath app_path;
+ PathService::Get(base::FILE_EXE, &app_path);
+ GURL app_url = FilePathToFileURL(app_path);
+
+ TestDelegate d;
+ {
+ URLRequest r(app_url, &d, &default_context_);
+
+ r.Start();
+ EXPECT_TRUE(r.is_pending());
+ r.Cancel();
+ }
+ // Async cancelation should be safe even when URLRequest has been already
+ // destroyed.
+ MessageLoop::current()->RunUntilIdle();
+}
+
TEST_F(URLRequestTest, FileTestFullSpecifiedRange) {
const size_t buffer_size = 4000;
scoped_array<char> buffer(new char[buffer_size]);
« no previous file with comments | « net/url_request/url_request_file_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698