| 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/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
| 9 #include "content/browser/service_worker/service_worker_context_core.h" | 9 #include "content/browser/service_worker/service_worker_context_core.h" |
| 10 #include "content/browser/service_worker/service_worker_disk_cache.h" | 10 #include "content/browser/service_worker/service_worker_disk_cache.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| 145 | 145 |
| 146 class ServiceWorkerStorageTest : public testing::Test { | 146 class ServiceWorkerStorageTest : public testing::Test { |
| 147 public: | 147 public: |
| 148 ServiceWorkerStorageTest() | 148 ServiceWorkerStorageTest() |
| 149 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) { | 149 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) { |
| 150 } | 150 } |
| 151 | 151 |
| 152 virtual void SetUp() OVERRIDE { | 152 virtual void SetUp() OVERRIDE { |
| 153 context_.reset(new ServiceWorkerContextCore( | 153 context_.reset( |
| 154 base::FilePath(), | 154 new ServiceWorkerContextCore(base::FilePath(), |
| 155 base::MessageLoopProxy::current(), | 155 base::MessageLoopProxy::current(), |
| 156 base::MessageLoopProxy::current(), | 156 base::MessageLoopProxy::current(), |
| 157 NULL, | 157 NULL, |
| 158 NULL, | 158 NULL, |
| 159 scoped_ptr<ServiceWorkerProcessManager>())); | 159 NULL)); |
| 160 context_ptr_ = context_->AsWeakPtr(); | 160 context_ptr_ = context_->AsWeakPtr(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 virtual void TearDown() OVERRIDE { | 163 virtual void TearDown() OVERRIDE { |
| 164 context_.reset(); | 164 context_.reset(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 ServiceWorkerStorage* storage() { return context_->storage(); } | 167 ServiceWorkerStorage* storage() { return context_->storage(); } |
| 168 | 168 |
| 169 // A static class method for friendliness. | 169 // A static class method for friendliness. |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 verify_ids.clear(); | 603 verify_ids.clear(); |
| 604 EXPECT_EQ(ServiceWorkerDatabase::STATUS_OK, | 604 EXPECT_EQ(ServiceWorkerDatabase::STATUS_OK, |
| 605 storage()->database_->GetPurgeableResourceIds(&verify_ids)); | 605 storage()->database_->GetPurgeableResourceIds(&verify_ids)); |
| 606 EXPECT_TRUE(verify_ids.empty()); | 606 EXPECT_TRUE(verify_ids.empty()); |
| 607 | 607 |
| 608 EXPECT_FALSE(VerifyBasicResponse(storage(), kResourceId1, false)); | 608 EXPECT_FALSE(VerifyBasicResponse(storage(), kResourceId1, false)); |
| 609 EXPECT_FALSE(VerifyBasicResponse(storage(), kResourceId2, false)); | 609 EXPECT_FALSE(VerifyBasicResponse(storage(), kResourceId2, false)); |
| 610 } | 610 } |
| 611 | 611 |
| 612 } // namespace content | 612 } // namespace content |
| OLD | NEW |