| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/files/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
| 6 #include "base/message_loop/message_loop_proxy.h" | 6 #include "base/message_loop/message_loop_proxy.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
| 10 #include "content/browser/gpu/shader_disk_cache.h" | 10 #include "content/browser/gpu/shader_disk_cache.h" |
| 11 #include "content/browser/storage_partition_impl.h" | 11 #include "content/browser/storage_partition_impl.h" |
| 12 #include "content/public/browser/cookie_store_map.h" |
| 12 #include "content/public/browser/storage_partition.h" | 13 #include "content/public/browser/storage_partition.h" |
| 13 #include "content/public/test/test_browser_thread_bundle.h" | 14 #include "content/public/test/test_browser_thread_bundle.h" |
| 14 #include "net/base/test_completion_callback.h" | 15 #include "net/base/test_completion_callback.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 class TestClosureCallback { | 21 class TestClosureCallback { |
| 21 public: | 22 public: |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 base::Time time; | 101 base::Time time; |
| 101 sp->AsyncClearDataBetween(content::StoragePartition::kShaderStorage, | 102 sp->AsyncClearDataBetween(content::StoragePartition::kShaderStorage, |
| 102 time, time, cb); | 103 time, time, cb); |
| 103 } | 104 } |
| 104 | 105 |
| 105 TEST_F(StoragePartitionShaderClearTest, ClearShaderCache) { | 106 TEST_F(StoragePartitionShaderClearTest, ClearShaderCache) { |
| 106 InitCache(); | 107 InitCache(); |
| 107 EXPECT_EQ(1u, Size()); | 108 EXPECT_EQ(1u, Size()); |
| 108 | 109 |
| 109 TestClosureCallback clear_cb; | 110 TestClosureCallback clear_cb; |
| 110 StoragePartitionImpl sp(cache_path(), | 111 StoragePartitionImpl sp(cache_path(), NULL, NULL, NULL, NULL, NULL, NULL, |
| 111 NULL, | 112 scoped_ptr<CookieStoreMap>(), |
| 112 NULL, | |
| 113 NULL, | |
| 114 NULL, | |
| 115 NULL, | |
| 116 NULL, | |
| 117 scoped_ptr<WebRTCIdentityStore>()); | 113 scoped_ptr<WebRTCIdentityStore>()); |
| 118 base::MessageLoop::current()->PostTask( | 114 base::MessageLoop::current()->PostTask( |
| 119 FROM_HERE, base::Bind(&ClearData, &sp, clear_cb.callback())); | 115 FROM_HERE, base::Bind(&ClearData, &sp, clear_cb.callback())); |
| 120 clear_cb.WaitForResult(); | 116 clear_cb.WaitForResult(); |
| 121 EXPECT_EQ(0u, Size()); | 117 EXPECT_EQ(0u, Size()); |
| 122 } | 118 } |
| 123 | 119 |
| 124 } // namespace content | 120 } // namespace content |
| OLD | NEW |