| 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/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 #include "content/browser/service_worker/embedded_worker_instance.h" | 7 #include "content/browser/service_worker/embedded_worker_instance.h" |
| 8 #include "content/browser/service_worker/embedded_worker_registry.h" | 8 #include "content/browser/service_worker/embedded_worker_registry.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/common/service_worker_messages.h" | 10 #include "content/common/service_worker/embedded_worker_messages.h" |
| 11 #include "content/public/test/test_browser_thread_bundle.h" | 11 #include "content/public/test/test_browser_thread_bundle.h" |
| 12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
| 13 #include "ipc/ipc_sender.h" | 13 #include "ipc/ipc_sender.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 typedef std::vector<IPC::Message*> MessageList; | 20 typedef std::vector<IPC::Message*> MessageList; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 embedded_worker_registry()->AddChildProcessSender(2, &fake_sender); | 128 embedded_worker_registry()->AddChildProcessSender(2, &fake_sender); |
| 129 embedded_worker_registry()->AddChildProcessSender(3, &fake_sender); | 129 embedded_worker_registry()->AddChildProcessSender(3, &fake_sender); |
| 130 | 130 |
| 131 // Process 3 has the biggest # of references and it should be chosen. | 131 // Process 3 has the biggest # of references and it should be chosen. |
| 132 EXPECT_TRUE(worker->Start(1L, GURL("http://example.com/worker.js"))); | 132 EXPECT_TRUE(worker->Start(1L, GURL("http://example.com/worker.js"))); |
| 133 EXPECT_EQ(EmbeddedWorkerInstance::STARTING, worker->status()); | 133 EXPECT_EQ(EmbeddedWorkerInstance::STARTING, worker->status()); |
| 134 EXPECT_EQ(3, worker->process_id()); | 134 EXPECT_EQ(3, worker->process_id()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace content | 137 } // namespace content |
| OLD | NEW |