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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "content/browser/service_worker/embedded_worker_instance.h" | 8 #include "content/browser/service_worker/embedded_worker_instance.h" |
9 #include "content/browser/service_worker/embedded_worker_registry.h" | 9 #include "content/browser/service_worker/embedded_worker_registry.h" |
10 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 10 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 EmbeddedWorkerRegistry* embedded_worker_registry() { | 37 EmbeddedWorkerRegistry* embedded_worker_registry() { |
38 DCHECK(context()); | 38 DCHECK(context()); |
39 return context()->embedded_worker_registry(); | 39 return context()->embedded_worker_registry(); |
40 } | 40 } |
41 | 41 |
42 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } | 42 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } |
43 | 43 |
44 TestBrowserThreadBundle thread_bundle_; | 44 TestBrowserThreadBundle thread_bundle_; |
45 scoped_ptr<EmbeddedWorkerTestHelper> helper_; | 45 scoped_ptr<EmbeddedWorkerTestHelper> helper_; |
46 | 46 |
| 47 private: |
47 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceTest); | 48 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceTest); |
48 }; | 49 }; |
49 | 50 |
50 static void SaveStatusAndCall(ServiceWorkerStatusCode* out, | 51 static void SaveStatusAndCall(ServiceWorkerStatusCode* out, |
51 const base::Closure& callback, | 52 const base::Closure& callback, |
52 ServiceWorkerStatusCode status) { | 53 ServiceWorkerStatusCode status) { |
53 *out = status; | 54 *out = status; |
54 callback.Run(); | 55 callback.Run(); |
55 } | 56 } |
56 | 57 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 registering_processes.push_back(1); | 161 registering_processes.push_back(1); |
161 registering_processes.push_back(4); | 162 registering_processes.push_back(4); |
162 EXPECT_THAT(worker->SortProcesses(registering_processes), | 163 EXPECT_THAT(worker->SortProcesses(registering_processes), |
163 testing::ElementsAre(1, 3, 2, 4)); | 164 testing::ElementsAre(1, 3, 2, 4)); |
164 | 165 |
165 EXPECT_THAT(worker->SortProcesses(std::vector<int>()), | 166 EXPECT_THAT(worker->SortProcesses(std::vector<int>()), |
166 testing::ElementsAre(3, 2, 1)); | 167 testing::ElementsAre(3, 2, 1)); |
167 } | 168 } |
168 | 169 |
169 } // namespace content | 170 } // namespace content |
OLD | NEW |