OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/thread.h" | 8 #include "base/thread.h" |
9 #include "base/waitable_event.h" | 9 #include "base/waitable_event.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // LoadCache_NearHit ------------------------------------------------- | 309 // LoadCache_NearHit ------------------------------------------------- |
310 | 310 |
311 void LoadCache_NearHit() { | 311 void LoadCache_NearHit() { |
312 // Attempt to load a cache that is currently in use | 312 // Attempt to load a cache that is currently in use |
313 // and does not require loading from storage. This | 313 // and does not require loading from storage. This |
314 // load should complete syncly. | 314 // load should complete syncly. |
315 | 315 |
316 // Setup some preconditions. Make an 'unstored' cache for | 316 // Setup some preconditions. Make an 'unstored' cache for |
317 // us to load. The ctor should put it in the working set. | 317 // us to load. The ctor should put it in the working set. |
318 int64 cache_id = storage()->NewCacheId(); | 318 int64 cache_id = storage()->NewCacheId(); |
319 scoped_refptr<AppCache> cache = new AppCache(service(), cache_id); | 319 scoped_refptr<AppCache> cache(new AppCache(service(), cache_id)); |
320 | 320 |
321 // Conduct the test. | 321 // Conduct the test. |
322 storage()->LoadCache(cache_id, delegate()); | 322 storage()->LoadCache(cache_id, delegate()); |
323 EXPECT_EQ(cache_id, delegate()->loaded_cache_id_); | 323 EXPECT_EQ(cache_id, delegate()->loaded_cache_id_); |
324 EXPECT_EQ(cache.get(), delegate()->loaded_cache_.get()); | 324 EXPECT_EQ(cache.get(), delegate()->loaded_cache_.get()); |
325 TestFinished(); | 325 TestFinished(); |
326 } | 326 } |
327 | 327 |
328 // CreateGroup -------------------------------------------- | 328 // CreateGroup -------------------------------------------- |
329 | 329 |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 &AppCacheStorageImplTest::FindMainResponseExclusionsInWorkingSet); | 1115 &AppCacheStorageImplTest::FindMainResponseExclusionsInWorkingSet); |
1116 } | 1116 } |
1117 | 1117 |
1118 // That's all folks! | 1118 // That's all folks! |
1119 | 1119 |
1120 } // namespace appcache | 1120 } // namespace appcache |
1121 | 1121 |
1122 // AppCacheStorageImplTest is expected to always live longer than the | 1122 // AppCacheStorageImplTest is expected to always live longer than the |
1123 // runnable methods. This lets us call NewRunnableMethod on its instances. | 1123 // runnable methods. This lets us call NewRunnableMethod on its instances. |
1124 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheStorageImplTest); | 1124 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheStorageImplTest); |
OLD | NEW |