| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 virtual void SetUp() OVERRIDE { | 35 virtual void SetUp() OVERRIDE { |
| 36 EXPECT_TRUE(dir_.CreateUniqueTempDir()); | 36 EXPECT_TRUE(dir_.CreateUniqueTempDir()); |
| 37 quota_manager_ = new quota::QuotaManager( | 37 quota_manager_ = new quota::QuotaManager( |
| 38 false, dir_.path(), | 38 false, dir_.path(), |
| 39 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 39 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 40 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), | 40 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), |
| 41 NULL); | 41 NULL); |
| 42 helper_ = new BrowsingDataQuotaHelperImpl( | 42 helper_ = new BrowsingDataQuotaHelperImpl( |
| 43 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 43 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 44 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 44 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 45 quota_manager_); | 45 quota_manager_.get()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 virtual void TearDown() OVERRIDE { | 48 virtual void TearDown() OVERRIDE { |
| 49 helper_ = NULL; | 49 helper_ = NULL; |
| 50 quota_manager_ = NULL; | 50 quota_manager_ = NULL; |
| 51 quota_info_.clear(); | 51 quota_info_.clear(); |
| 52 base::MessageLoop::current()->RunUntilIdle(); | 52 base::MessageLoop::current()->RunUntilIdle(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 protected: | 55 protected: |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 base::MessageLoop::current()->RunUntilIdle(); | 199 base::MessageLoop::current()->RunUntilIdle(); |
| 200 | 200 |
| 201 GetPersistentHostQuota(kHost1); | 201 GetPersistentHostQuota(kHost1); |
| 202 base::MessageLoop::current()->RunUntilIdle(); | 202 base::MessageLoop::current()->RunUntilIdle(); |
| 203 EXPECT_EQ(0, quota()); | 203 EXPECT_EQ(0, quota()); |
| 204 | 204 |
| 205 GetPersistentHostQuota(kHost2); | 205 GetPersistentHostQuota(kHost2); |
| 206 base::MessageLoop::current()->RunUntilIdle(); | 206 base::MessageLoop::current()->RunUntilIdle(); |
| 207 EXPECT_EQ(10, quota()); | 207 EXPECT_EQ(10, quota()); |
| 208 } | 208 } |
| OLD | NEW |