| Index: net/url_request/url_request_file_job_unittest.cc
|
| diff --git a/net/url_request/url_request_file_job_unittest.cc b/net/url_request/url_request_file_job_unittest.cc
|
| index 2e5aafffbc26a04e1287ab51dd5dfdb17ae85d46..a599da4bcaa2ec682d6e3d189b224cb7c9b874a8 100644
|
| --- a/net/url_request/url_request_file_job_unittest.cc
|
| +++ b/net/url_request/url_request_file_job_unittest.cc
|
| @@ -54,12 +54,14 @@ class TestURLRequestFileJob : public URLRequestFileJob {
|
|
|
| protected:
|
| void OnOpenComplete(int result) override {
|
| + printf("T: OnOpenComplete: %d\n", result);
|
| // Should only be called once.
|
| ASSERT_EQ(ERR_IO_PENDING, *open_result_);
|
| *open_result_ = result;
|
| }
|
|
|
| void OnSeekComplete(int64_t result) override {
|
| + printf("T: OnSeekComplete: %ld\n", result);
|
| // Should only call this if open succeeded.
|
| EXPECT_EQ(OK, *open_result_);
|
| // Should only be called once.
|
| @@ -68,6 +70,7 @@ class TestURLRequestFileJob : public URLRequestFileJob {
|
| }
|
|
|
| void OnReadComplete(IOBuffer* buf, int result) override {
|
| + printf("T: OnReadComplete: %d\n", result);
|
| // Should only call this if seek succeeded.
|
| EXPECT_GE(*seek_position_, 0);
|
| observed_content_->append(std::string(buf->data(), result));
|
| @@ -150,7 +153,7 @@ class TestJobFactory : public URLRequestJobFactory {
|
| // Returns true on success.
|
| bool CreateFileWithContent(const std::string& content,
|
| const base::FilePath& path) {
|
| - return base::WriteFile(path, content.c_str(), content.length());
|
| + return base::WriteFile(path, content.c_str(), content.length()) != -1;
|
| }
|
|
|
| // A simple holder for start/end used in http range requests.
|
| @@ -308,6 +311,10 @@ TEST_F(URLRequestFileJobEventsTest, TinyFile) {
|
| RunSuccessfulRequestWithString(std::string("hello world"), NULL);
|
| }
|
|
|
| +TEST_F(URLRequestFileJobEventsTest, ZeroFile) {
|
| + RunSuccessfulRequestWithString(std::string(""), NULL);
|
| +}
|
| +
|
| TEST_F(URLRequestFileJobEventsTest, SmallFile) {
|
| RunSuccessfulRequestWithString(MakeContentOfSize(17 * 1024), NULL);
|
| }
|
|
|