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

Side by Side Diff: webkit/browser/appcache/appcache_storage_impl_unittest.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/compositor/layer.cc ('k') | webkit/browser/blob/blob_storage_context.cc » ('j') | 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) 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 <stack> 5 #include <stack>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 AppCacheEntry found_fallback_entry_; 139 AppCacheEntry found_fallback_entry_;
140 int64 found_cache_id_; 140 int64 found_cache_id_;
141 int64 found_group_id_; 141 int64 found_group_id_;
142 GURL found_manifest_url_; 142 GURL found_manifest_url_;
143 AppCacheStorageImplTest* test_; 143 AppCacheStorageImplTest* test_;
144 }; 144 };
145 145
146 class MockQuotaManager : public quota::QuotaManager { 146 class MockQuotaManager : public quota::QuotaManager {
147 public: 147 public:
148 MockQuotaManager() 148 MockQuotaManager()
149 : QuotaManager(true /* is_incognito */, base::FilePath(), 149 : QuotaManager(true /* is_incognito */,
150 io_thread->message_loop_proxy(), 150 base::FilePath(),
151 db_thread->message_loop_proxy(), 151 io_thread->message_loop_proxy().get(),
152 NULL), 152 db_thread->message_loop_proxy().get(),
153 async_(false) {} 153 NULL),
154 async_(false) {}
154 155
155 virtual void GetUsageAndQuota( 156 virtual void GetUsageAndQuota(
156 const GURL& origin, 157 const GURL& origin,
157 quota::StorageType type, 158 quota::StorageType type,
158 const GetUsageAndQuotaCallback& callback) OVERRIDE { 159 const GetUsageAndQuotaCallback& callback) OVERRIDE {
159 EXPECT_EQ(kOrigin, origin); 160 EXPECT_EQ(kOrigin, origin);
160 EXPECT_EQ(quota::kStorageTypeTemporary, type); 161 EXPECT_EQ(quota::kStorageTypeTemporary, type);
161 if (async_) { 162 if (async_) {
162 base::MessageLoop::current()->PostTask( 163 base::MessageLoop::current()->PostTask(
163 FROM_HERE, 164 FROM_HERE,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 io_thread->message_loop()->PostTask( 275 io_thread->message_loop()->PostTask(
275 FROM_HERE, base::Bind(&AppCacheStorageImplTest::MethodWrapper<Method>, 276 FROM_HERE, base::Bind(&AppCacheStorageImplTest::MethodWrapper<Method>,
276 base::Unretained(this), method)); 277 base::Unretained(this), method));
277 test_finished_event_->Wait(); 278 test_finished_event_->Wait();
278 } 279 }
279 280
280 void SetUpTest() { 281 void SetUpTest() {
281 DCHECK(base::MessageLoop::current() == io_thread->message_loop()); 282 DCHECK(base::MessageLoop::current() == io_thread->message_loop());
282 service_.reset(new AppCacheService(NULL)); 283 service_.reset(new AppCacheService(NULL));
283 service_->Initialize( 284 service_->Initialize(
284 base::FilePath(), db_thread->message_loop_proxy(), NULL); 285 base::FilePath(), db_thread->message_loop_proxy().get(), NULL);
285 mock_quota_manager_proxy_ = new MockQuotaManagerProxy(); 286 mock_quota_manager_proxy_ = new MockQuotaManagerProxy();
286 service_->quota_manager_proxy_ = mock_quota_manager_proxy_; 287 service_->quota_manager_proxy_ = mock_quota_manager_proxy_;
287 delegate_.reset(new MockStorageDelegate(this)); 288 delegate_.reset(new MockStorageDelegate(this));
288 } 289 }
289 290
290 void TearDownTest() { 291 void TearDownTest() {
291 DCHECK(base::MessageLoop::current() == io_thread->message_loop()); 292 DCHECK(base::MessageLoop::current() == io_thread->message_loop());
292 storage()->CancelDelegateCallbacks(delegate()); 293 storage()->CancelDelegateCallbacks(delegate());
293 group_ = NULL; 294 group_ = NULL;
294 cache_ = NULL; 295 cache_ = NULL;
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 } 1637 }
1637 1638
1638 TEST_F(AppCacheStorageImplTest, FindFallbackPatternMatchInDatabase) { 1639 TEST_F(AppCacheStorageImplTest, FindFallbackPatternMatchInDatabase) {
1639 RunTestOnIOThread( 1640 RunTestOnIOThread(
1640 &AppCacheStorageImplTest::FindFallbackPatternMatchInDatabase); 1641 &AppCacheStorageImplTest::FindFallbackPatternMatchInDatabase);
1641 } 1642 }
1642 1643
1643 // That's all folks! 1644 // That's all folks!
1644 1645
1645 } // namespace appcache 1646 } // namespace appcache
OLDNEW
« no previous file with comments | « ui/compositor/layer.cc ('k') | webkit/browser/blob/blob_storage_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698