| 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 "chrome/browser/drive/fake_drive_service.h" | 5 #include "chrome/browser/drive/fake_drive_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 "file:2_file_resource_id", | 896 "file:2_file_resource_id", |
| 897 test_util::CreateCopyResultCallback(&error, &output_file_path), | 897 test_util::CreateCopyResultCallback(&error, &output_file_path), |
| 898 get_content_callback.callback(), | 898 get_content_callback.callback(), |
| 899 base::Bind(&test_util::AppendProgressCallbackResult, | 899 base::Bind(&test_util::AppendProgressCallbackResult, |
| 900 &download_progress_values)); | 900 &download_progress_values)); |
| 901 base::RunLoop().RunUntilIdle(); | 901 base::RunLoop().RunUntilIdle(); |
| 902 | 902 |
| 903 EXPECT_EQ(HTTP_SUCCESS, error); | 903 EXPECT_EQ(HTTP_SUCCESS, error); |
| 904 EXPECT_EQ(output_file_path, kOutputFilePath); | 904 EXPECT_EQ(output_file_path, kOutputFilePath); |
| 905 std::string content; | 905 std::string content; |
| 906 ASSERT_TRUE(file_util::ReadFileToString(output_file_path, &content)); | 906 ASSERT_TRUE(base::ReadFileToString(output_file_path, &content)); |
| 907 // The content is "x"s of the file size specified in root_feed.json. | 907 // The content is "x"s of the file size specified in root_feed.json. |
| 908 EXPECT_EQ("This is some test content.", content); | 908 EXPECT_EQ("This is some test content.", content); |
| 909 ASSERT_TRUE(!download_progress_values.empty()); | 909 ASSERT_TRUE(!download_progress_values.empty()); |
| 910 EXPECT_TRUE(base::STLIsSorted(download_progress_values)); | 910 EXPECT_TRUE(base::STLIsSorted(download_progress_values)); |
| 911 EXPECT_LE(0, download_progress_values.front().first); | 911 EXPECT_LE(0, download_progress_values.front().first); |
| 912 EXPECT_GE(26, download_progress_values.back().first); | 912 EXPECT_GE(26, download_progress_values.back().first); |
| 913 EXPECT_EQ(content, get_content_callback.GetConcatenatedData()); | 913 EXPECT_EQ(content, get_content_callback.GetConcatenatedData()); |
| 914 } | 914 } |
| 915 | 915 |
| 916 TEST_F(FakeDriveServiceTest, DownloadFile_NonexistingFile) { | 916 TEST_F(FakeDriveServiceTest, DownloadFile_NonexistingFile) { |
| (...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 test_util::CreateCopyResultCallback(&error, &resource_entry)); | 2283 test_util::CreateCopyResultCallback(&error, &resource_entry)); |
| 2284 base::RunLoop().RunUntilIdle(); | 2284 base::RunLoop().RunUntilIdle(); |
| 2285 | 2285 |
| 2286 EXPECT_EQ(GDATA_NO_CONNECTION, error); | 2286 EXPECT_EQ(GDATA_NO_CONNECTION, error); |
| 2287 EXPECT_FALSE(resource_entry); | 2287 EXPECT_FALSE(resource_entry); |
| 2288 } | 2288 } |
| 2289 | 2289 |
| 2290 } // namespace | 2290 } // namespace |
| 2291 | 2291 |
| 2292 } // namespace drive | 2292 } // namespace drive |
| OLD | NEW |