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/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Initialize FakeDriveService. | 106 // Initialize FakeDriveService. |
107 fake_drive_service_.reset(new FakeDriveService); | 107 fake_drive_service_.reset(new FakeDriveService); |
108 ASSERT_TRUE(fake_drive_service_->LoadResourceListForWapi( | 108 ASSERT_TRUE(fake_drive_service_->LoadResourceListForWapi( |
109 "gdata/root_feed.json")); | 109 "gdata/root_feed.json")); |
110 ASSERT_TRUE(fake_drive_service_->LoadAccountMetadataForWapi( | 110 ASSERT_TRUE(fake_drive_service_->LoadAccountMetadataForWapi( |
111 "gdata/account_metadata.json")); | 111 "gdata/account_metadata.json")); |
112 | 112 |
113 // Initialize FakeFileSystem. | 113 // Initialize FakeFileSystem. |
114 fake_file_system_.reset( | 114 fake_file_system_.reset( |
115 new test_util::FakeFileSystem(fake_drive_service_.get())); | 115 new test_util::FakeFileSystem(fake_drive_service_.get())); |
116 ASSERT_TRUE(fake_file_system_->InitializeForTesting()); | |
117 | 116 |
118 scoped_refptr<base::SequencedWorkerPool> blocking_pool = | 117 scoped_refptr<base::SequencedWorkerPool> blocking_pool = |
119 content::BrowserThread::GetBlockingPool(); | 118 content::BrowserThread::GetBlockingPool(); |
120 test_network_delegate_.reset(new net::TestNetworkDelegate); | 119 test_network_delegate_.reset(new net::TestNetworkDelegate); |
121 test_url_request_job_factory_.reset(new TestURLRequestJobFactory( | 120 test_url_request_job_factory_.reset(new TestURLRequestJobFactory( |
122 base::Bind(&DriveURLRequestJobTest::GetFileSystem, | 121 base::Bind(&DriveURLRequestJobTest::GetFileSystem, |
123 base::Unretained(this)), | 122 base::Unretained(this)), |
124 blocking_pool->GetSequencedTaskRunner( | 123 blocking_pool->GetSequencedTaskRunner( |
125 blocking_pool->GetSequenceToken()).get())); | 124 blocking_pool->GetSequenceToken()).get())); |
126 url_request_context_.reset(new net::URLRequestContext()); | 125 url_request_context_.reset(new net::URLRequestContext()); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 "Range", "Wrong Range Header Value", false /* overwrite */); | 360 "Range", "Wrong Range Header Value", false /* overwrite */); |
362 request.Start(); | 361 request.Start(); |
363 | 362 |
364 base::RunLoop().Run(); | 363 base::RunLoop().Run(); |
365 | 364 |
366 EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); | 365 EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); |
367 EXPECT_EQ(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE, request.status().error()); | 366 EXPECT_EQ(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE, request.status().error()); |
368 } | 367 } |
369 | 368 |
370 } // namespace drive | 369 } // namespace drive |
OLD | NEW |