| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
| 9 #include "content/browser/download/download_create_info.h" | 9 #include "content/browser/download/download_create_info.h" |
| 10 #include "content/browser/download/download_file_impl.h" | 10 #include "content/browser/download/download_file_impl.h" |
| 11 #include "content/browser/download/download_request_handle.h" | 11 #include "content/browser/download/download_request_handle.h" |
| 12 #include "content/browser/power_save_blocker.h" | 12 #include "content/browser/power_save_blocker.h" |
| 13 #include "content/public/browser/download_manager.h" | 13 #include "content/public/browser/download_manager.h" |
| 14 #include "content/test/mock_download_manager.h" | 14 #include "content/public/test/mock_download_manager.h" |
| 15 #include "net/base/file_stream.h" | 15 #include "net/base/file_stream.h" |
| 16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 using content::BrowserThread; | 19 using content::BrowserThread; |
| 20 using content::BrowserThreadImpl; | 20 using content::BrowserThreadImpl; |
| 21 using content::DownloadFile; | 21 using content::DownloadFile; |
| 22 using content::DownloadId; | 22 using content::DownloadId; |
| 23 using content::DownloadManager; | 23 using content::DownloadManager; |
| 24 using testing::_; | 24 using testing::_; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 base::TimeDelta::FromMilliseconds(750)); | 235 base::TimeDelta::FromMilliseconds(750)); |
| 236 loop_.Run(); | 236 loop_.Run(); |
| 237 | 237 |
| 238 EXPECT_EQ(static_cast<int64>(strlen(kTestData1) + strlen(kTestData2)), | 238 EXPECT_EQ(static_cast<int64>(strlen(kTestData1) + strlen(kTestData2)), |
| 239 bytes_); | 239 bytes_); |
| 240 EXPECT_EQ(download_file_->GetHashState(), hash_state_); | 240 EXPECT_EQ(download_file_->GetHashState(), hash_state_); |
| 241 | 241 |
| 242 download_file_->Finish(); | 242 download_file_->Finish(); |
| 243 DestroyDownloadFile(&download_file_, 0); | 243 DestroyDownloadFile(&download_file_, 0); |
| 244 } | 244 } |
| OLD | NEW |