Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: third_party/zlib/google/zip_reader_unittest.cc

Issue 683913009: Eliminate resource leaks from zip::ZipFiles and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/zlib/google/zip_reader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/zlib/google/zip_reader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698