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 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) | 5 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) |
6 // rather than as part of test_shell_tests because they rely on being able | 6 // rather than as part of test_shell_tests because they rely on being able |
7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses | 7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses |
8 // TYPE_UI, which URLRequest doesn't allow. | 8 // TYPE_UI, which URLRequest doesn't allow. |
9 // | 9 // |
10 | 10 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 349 |
350 ASSERT_EQ(kDataSize * 2, test_helper_.GetCachedOriginUsage()); | 350 ASSERT_EQ(kDataSize * 2, test_helper_.GetCachedOriginUsage()); |
351 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); | 351 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); |
352 | 352 |
353 EXPECT_EQ(kDataSize, result_->bytes_written()); | 353 EXPECT_EQ(kDataSize, result_->bytes_written()); |
354 EXPECT_EQ(base::PLATFORM_FILE_OK, result_->status()); | 354 EXPECT_EQ(base::PLATFORM_FILE_OK, result_->status()); |
355 EXPECT_EQ(kDataSize, result2->bytes_written()); | 355 EXPECT_EQ(kDataSize, result2->bytes_written()); |
356 EXPECT_EQ(base::PLATFORM_FILE_OK, result2->status()); | 356 EXPECT_EQ(base::PLATFORM_FILE_OK, result2->status()); |
357 } | 357 } |
358 | 358 |
359 TEST_F(FileWriterDelegateTest, WritesWithQuotaAndOffset) { | 359 #if defined(OS_WIN) |
| 360 // See http://crbug.com/129264 |
| 361 #define MAYBE_WritesWithQuotaAndOffset \ |
| 362 DISABLED_WritesWithQuotaAndOffset |
| 363 #else |
| 364 #define MAYBE_WritesWithQuotaAndOffset \ |
| 365 WritesWithQuotaAndOffset |
| 366 #endif |
| 367 |
| 368 TEST_F(FileWriterDelegateTest, MAYBE_WritesWithQuotaAndOffset) { |
360 const GURL kBlobURL("blob:failure-with-updated-quota"); | 369 const GURL kBlobURL("blob:failure-with-updated-quota"); |
361 content_ = kData; | 370 content_ = kData; |
362 | 371 |
363 // Writing kDataSize (=45) bytes data while allowed_growth is 100. | 372 // Writing kDataSize (=45) bytes data while allowed_growth is 100. |
364 int64 offset = 0; | 373 int64 offset = 0; |
365 int64 allowed_growth = 100; | 374 int64 allowed_growth = 100; |
366 ASSERT_LT(kDataSize, allowed_growth); | 375 ASSERT_LT(kDataSize, allowed_growth); |
367 PrepareForWrite(kBlobURL, offset, allowed_growth); | 376 PrepareForWrite(kBlobURL, offset, allowed_growth); |
368 | 377 |
369 ASSERT_EQ(0, test_helper_.GetCachedOriginUsage()); | 378 ASSERT_EQ(0, test_helper_.GetCachedOriginUsage()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 file_writer_delegate_.reset(); | 444 file_writer_delegate_.reset(); |
436 | 445 |
437 EXPECT_EQ(pre_write_usage + allowed_growth, | 446 EXPECT_EQ(pre_write_usage + allowed_growth, |
438 test_helper_.GetCachedOriginUsage()); | 447 test_helper_.GetCachedOriginUsage()); |
439 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); | 448 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); |
440 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written()); | 449 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written()); |
441 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status()); | 450 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status()); |
442 } | 451 } |
443 | 452 |
444 } // namespace fileapi | 453 } // namespace fileapi |
OLD | NEW |