OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "third_party/zlib/google/zip_reader.h" | 5 #include "third_party/zlib/google/zip_reader.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } | 566 } |
567 | 567 |
568 // More than necessary byte read limit: must pass. | 568 // More than necessary byte read limit: must pass. |
569 EXPECT_TRUE(reader.ExtractCurrentEntryToString(16, &contents)); | 569 EXPECT_TRUE(reader.ExtractCurrentEntryToString(16, &contents)); |
570 EXPECT_EQ(i, contents.size()); | 570 EXPECT_EQ(i, contents.size()); |
571 EXPECT_EQ(0, memcmp(contents.c_str(), "0123456", i)); | 571 EXPECT_EQ(0, memcmp(contents.c_str(), "0123456", i)); |
572 } | 572 } |
573 reader.Close(); | 573 reader.Close(); |
574 } | 574 } |
575 | 575 |
| 576 // This test exposes http://crbug.com/430959, at least on OS X |
| 577 TEST_F(ZipReaderTest, DISABLED_LeakDetectionTest) { |
| 578 for (int i = 0; i < 100000; ++i) { |
| 579 FileWrapper zip_fd_wrapper(test_zip_file_, FileWrapper::READ_ONLY); |
| 580 ZipReader reader; |
| 581 ASSERT_TRUE(reader.OpenFromPlatformFile(zip_fd_wrapper.platform_file())); |
| 582 } |
| 583 } |
| 584 |
576 } // namespace zip | 585 } // namespace zip |
OLD | NEW |