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

Unified Diff: webkit/fileapi/file_system_operation_unittest.cc

Issue 7053029: Leak fix in FileSystemOperationUnitTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_operation_unittest.cc
diff --git a/webkit/fileapi/file_system_operation_unittest.cc b/webkit/fileapi/file_system_operation_unittest.cc
index 9e4844d94b356529c874864f5f0b697b3003e935..92bb2e90dce83b5a3f6f0f7bb245df6bd260b1c2 100644
--- a/webkit/fileapi/file_system_operation_unittest.cc
+++ b/webkit/fileapi/file_system_operation_unittest.cc
@@ -88,10 +88,27 @@ class MockQuotaManagerProxy : public QuotaManagerProxy {
public:
explicit MockQuotaManagerProxy(QuotaManager* quota_manager)
: QuotaManagerProxy(quota_manager,
- base::MessageLoopProxy::CreateForCurrentThread()) {}
+ base::MessageLoopProxy::CreateForCurrentThread()),
+ registered_client_(NULL) {
+ }
+
+ virtual ~MockQuotaManagerProxy() {
+ EXPECT_FALSE(registered_client_);
oshima 2011/05/26 01:17:07 Any reason not deleting here? (deletion order matt
kinuko 2011/05/26 02:19:25 Yes there's an ordering issue. I added a comment.
+ }
+
+ virtual void RegisterClient(QuotaClient* client) {
+ EXPECT_FALSE(registered_client_);
+ registered_client_ = client;
+ }
+
+ void SimulateQuotaManagerDestroyed() {
+ if (registered_client_) {
+ registered_client_->OnQuotaManagerDestroyed();
+ registered_client_ = NULL;
+ }
+ }
// We don't mock them.
- virtual void RegisterClient(QuotaClient* client) OVERRIDE {}
virtual void NotifyOriginInUse(const GURL& origin) OVERRIDE {}
virtual void NotifyOriginNoLongerInUse(const GURL& origin) OVERRIDE {}
@@ -120,6 +137,7 @@ class MockQuotaManagerProxy : public QuotaManagerProxy {
MockQuotaManager* mock_manager() const {
return static_cast<MockQuotaManager*>(quota_manager());
}
+ QuotaClient* registered_client_;
};
FilePath ASCIIToFilePath(const std::string& str) {
@@ -287,6 +305,7 @@ void FileSystemOperationTest::SetUp() {
}
void FileSystemOperationTest::TearDown() {
+ quota_manager_proxy()->SimulateQuotaManagerDestroyed();
quota_manager_ = NULL;
quota_manager_proxy_ = NULL;
test_helper_.TearDown();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698