| 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/drive_uploader.h" | 5 #include "chrome/browser/drive/drive_uploader.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 return CancelCallback(); | 285 return CancelCallback(); |
| 286 } | 286 } |
| 287 }; | 287 }; |
| 288 | 288 |
| 289 class DriveUploaderTest : public testing::Test { | 289 class DriveUploaderTest : public testing::Test { |
| 290 public: | 290 public: |
| 291 virtual void SetUp() OVERRIDE { | 291 virtual void SetUp() OVERRIDE { |
| 292 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 292 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 293 } | 293 } |
| 294 | 294 |
| 295 virtual void TearDown() OVERRIDE { | |
| 296 ASSERT_TRUE(temp_dir_.Delete()); | |
| 297 } | |
| 298 | |
| 299 protected: | 295 protected: |
| 300 content::TestBrowserThreadBundle thread_bundle_; | 296 content::TestBrowserThreadBundle thread_bundle_; |
| 301 base::ScopedTempDir temp_dir_; | 297 base::ScopedTempDir temp_dir_; |
| 302 }; | 298 }; |
| 303 | 299 |
| 304 } // namespace | 300 } // namespace |
| 305 | 301 |
| 306 TEST_F(DriveUploaderTest, UploadExisting0KB) { | 302 TEST_F(DriveUploaderTest, UploadExisting0KB) { |
| 307 base::FilePath local_path; | 303 base::FilePath local_path; |
| 308 std::string data; | 304 std::string data; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 EXPECT_EQ(HTTP_SUCCESS, error); | 532 EXPECT_EQ(HTTP_SUCCESS, error); |
| 537 EXPECT_TRUE(upload_location.is_empty()); | 533 EXPECT_TRUE(upload_location.is_empty()); |
| 538 ASSERT_TRUE(resource_entry); | 534 ASSERT_TRUE(resource_entry); |
| 539 EXPECT_EQ(kTestDummyId, resource_entry->id()); | 535 EXPECT_EQ(kTestDummyId, resource_entry->id()); |
| 540 ASSERT_EQ(1U, upload_progress_values.size()); | 536 ASSERT_EQ(1U, upload_progress_values.size()); |
| 541 EXPECT_EQ(test_util::ProgressInfo(1024 * 1024, 1024 * 1024), | 537 EXPECT_EQ(test_util::ProgressInfo(1024 * 1024, 1024 * 1024), |
| 542 upload_progress_values[0]); | 538 upload_progress_values[0]); |
| 543 } | 539 } |
| 544 | 540 |
| 545 } // namespace drive | 541 } // namespace drive |
| OLD | NEW |