OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 } | 610 } |
611 } | 611 } |
612 | 612 |
613 private: | 613 private: |
614 DownloadManager::DownloadVector* items_; | 614 DownloadManager::DownloadVector* items_; |
615 DISALLOW_COPY_AND_ASSIGN(ScopedItemVectorCanceller); | 615 DISALLOW_COPY_AND_ASSIGN(ScopedItemVectorCanceller); |
616 }; | 616 }; |
617 | 617 |
618 class TestProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { | 618 class TestProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { |
619 public: | 619 public: |
620 explicit TestProtocolHandler( | 620 TestProtocolHandler( |
621 webkit_blob::BlobStorageController* blob_storage_controller, | 621 webkit_blob::BlobStorageController* blob_storage_controller, |
622 fileapi::FileSystemContext* file_system_context) | 622 fileapi::FileSystemContext* file_system_context) |
623 : blob_storage_controller_(blob_storage_controller), | 623 : blob_storage_controller_(blob_storage_controller), |
624 file_system_context_(file_system_context) {} | 624 file_system_context_(file_system_context) {} |
625 | 625 |
626 virtual ~TestProtocolHandler() {} | 626 virtual ~TestProtocolHandler() {} |
627 | 627 |
628 virtual net::URLRequestJob* MaybeCreateJob( | 628 virtual net::URLRequestJob* MaybeCreateJob( |
629 net::URLRequest* request, | 629 net::URLRequest* request, |
630 net::NetworkDelegate* network_delegate) const OVERRIDE { | 630 net::NetworkDelegate* network_delegate) const OVERRIDE { |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 " \"state\": {" | 2149 " \"state\": {" |
2150 " \"previous\": \"in_progress\"," | 2150 " \"previous\": \"in_progress\"," |
2151 " \"current\": \"complete\"}}]", | 2151 " \"current\": \"complete\"}}]", |
2152 result_id, | 2152 result_id, |
2153 GetFilename("on_record.txt.crdownload").c_str(), | 2153 GetFilename("on_record.txt.crdownload").c_str(), |
2154 GetFilename("on_record.txt").c_str()))); | 2154 GetFilename("on_record.txt").c_str()))); |
2155 std::string disk_data; | 2155 std::string disk_data; |
2156 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); | 2156 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); |
2157 EXPECT_STREQ(kPayloadData, disk_data.c_str()); | 2157 EXPECT_STREQ(kPayloadData, disk_data.c_str()); |
2158 } | 2158 } |
OLD | NEW |