OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/drive/drive_url_request_job.h" | 5 #include "chrome/browser/chromeos/drive/drive_url_request_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "net/base/test_completion_callback.h" | 23 #include "net/base/test_completion_callback.h" |
24 #include "net/http/http_byte_range.h" | 24 #include "net/http/http_byte_range.h" |
25 #include "net/url_request/url_request_test_util.h" | 25 #include "net/url_request/url_request_test_util.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
27 | 27 |
28 using content::BrowserThread; | 28 using content::BrowserThread; |
29 | 29 |
30 namespace drive { | 30 namespace drive { |
31 namespace { | 31 namespace { |
32 | 32 |
33 // A simple URLRequestJobFactory implementation to create DriveURLReuqestJob. | 33 // A simple URLRequestJobFactory implementation to create DriveURLRequestJob. |
34 class TestURLRequestJobFactory : public net::URLRequestJobFactory { | 34 class TestURLRequestJobFactory : public net::URLRequestJobFactory { |
35 public: | 35 public: |
36 TestURLRequestJobFactory( | 36 TestURLRequestJobFactory( |
37 const DriveURLRequestJob::FileSystemGetter& file_system_getter, | 37 const DriveURLRequestJob::FileSystemGetter& file_system_getter, |
38 base::SequencedTaskRunner* sequenced_task_runner) | 38 base::SequencedTaskRunner* sequenced_task_runner) |
39 : file_system_getter_(file_system_getter), | 39 : file_system_getter_(file_system_getter), |
40 sequenced_task_runner_(sequenced_task_runner) { | 40 sequenced_task_runner_(sequenced_task_runner) { |
41 } | 41 } |
42 | 42 |
43 virtual ~TestURLRequestJobFactory() {} | 43 virtual ~TestURLRequestJobFactory() {} |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 "Range", "Wrong Range Header Value", false /* overwrite */); | 393 "Range", "Wrong Range Header Value", false /* overwrite */); |
394 request.Start(); | 394 request.Start(); |
395 | 395 |
396 MessageLoop::current()->Run(); | 396 MessageLoop::current()->Run(); |
397 | 397 |
398 EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); | 398 EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); |
399 EXPECT_EQ(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE, request.status().error()); | 399 EXPECT_EQ(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE, request.status().error()); |
400 } | 400 } |
401 | 401 |
402 } // namespace drive | 402 } // namespace drive |
OLD | NEW |