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 "content/browser/service_worker/service_worker_storage.h" | 5 #include "content/browser/service_worker/service_worker_storage.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 class ServiceWorkerStorageTest : public testing::Test { | 68 class ServiceWorkerStorageTest : public testing::Test { |
69 public: | 69 public: |
70 ServiceWorkerStorageTest() | 70 ServiceWorkerStorageTest() |
71 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) { | 71 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) { |
72 } | 72 } |
73 | 73 |
74 virtual void SetUp() OVERRIDE { | 74 virtual void SetUp() OVERRIDE { |
75 context_.reset(new ServiceWorkerContextCore( | 75 context_.reset( |
76 base::FilePath(), | 76 new ServiceWorkerContextCore(base::FilePath(), |
77 base::MessageLoopProxy::current(), | 77 base::MessageLoopProxy::current(), |
78 base::MessageLoopProxy::current(), | 78 base::MessageLoopProxy::current(), |
79 NULL, | 79 NULL, |
80 NULL, | 80 NULL, |
81 scoped_ptr<ServiceWorkerProcessManager>())); | 81 NULL)); |
82 context_ptr_ = context_->AsWeakPtr(); | 82 context_ptr_ = context_->AsWeakPtr(); |
83 } | 83 } |
84 | 84 |
85 virtual void TearDown() OVERRIDE { | 85 virtual void TearDown() OVERRIDE { |
86 context_.reset(); | 86 context_.reset(); |
87 } | 87 } |
88 | 88 |
89 ServiceWorkerStorage* storage() { return context_->storage(); } | 89 ServiceWorkerStorage* storage() { return context_->storage(); } |
90 | 90 |
91 protected: | 91 protected: |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 436 |
437 storage()->GetAllRegistrations( | 437 storage()->GetAllRegistrations( |
438 MakeGetAllCallback(&was_called, &all_registrations)); | 438 MakeGetAllCallback(&was_called, &all_registrations)); |
439 base::RunLoop().RunUntilIdle(); | 439 base::RunLoop().RunUntilIdle(); |
440 ASSERT_TRUE(was_called); | 440 ASSERT_TRUE(was_called); |
441 EXPECT_TRUE(all_registrations.empty()); | 441 EXPECT_TRUE(all_registrations.empty()); |
442 was_called = false; | 442 was_called = false; |
443 } | 443 } |
444 | 444 |
445 } // namespace content | 445 } // namespace content |
OLD | NEW |