| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/shared_worker_devtools_manager.h" | 5 #include "content/browser/devtools/shared_worker_devtools_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void TearDown() override { | 64 void TearDown() override { |
| 65 SharedWorkerDevToolsManager::GetInstance()->ResetForTesting(); | 65 SharedWorkerDevToolsManager::GetInstance()->ResetForTesting(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void CheckWorkerState(int worker_process_id, | 68 void CheckWorkerState(int worker_process_id, |
| 69 int worker_route_id, | 69 int worker_route_id, |
| 70 WorkerState state) { | 70 WorkerState state) { |
| 71 const SharedWorkerDevToolsManager::WorkerId id(worker_process_id, | 71 const SharedWorkerDevToolsManager::WorkerId id(worker_process_id, |
| 72 worker_route_id); | 72 worker_route_id); |
| 73 SharedWorkerDevToolsManager::AgentHostMap::iterator it = | 73 SharedWorkerDevToolsManager::AgentHostMap::iterator it = |
| 74 manager_->workers().find(id); | 74 manager_->workers_.find(id); |
| 75 EXPECT_TRUE(manager_->workers_.end() != it); | 75 EXPECT_TRUE(manager_->workers_.end() != it); |
| 76 EXPECT_EQ(state, it->second->state_); | 76 EXPECT_EQ(state, it->second->state_); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void CheckWorkerNotExist(int worker_process_id, int worker_route_id) { | 79 void CheckWorkerNotExist(int worker_process_id, int worker_route_id) { |
| 80 const SharedWorkerDevToolsManager::WorkerId id(worker_process_id, | 80 const SharedWorkerDevToolsManager::WorkerId id(worker_process_id, |
| 81 worker_route_id); | 81 worker_route_id); |
| 82 EXPECT_TRUE(manager_->workers_.end() == manager_->workers_.find(id)); | 82 EXPECT_TRUE(manager_->workers_.end() == manager_->workers_.find(id)); |
| 83 } | 83 } |
| 84 | 84 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 manager_->WorkerCreated(3, 2, instance); | 289 manager_->WorkerCreated(3, 2, instance); |
| 290 CheckWorkerState(3, 2, WorkerState::WORKER_UNINSPECTED); | 290 CheckWorkerState(3, 2, WorkerState::WORKER_UNINSPECTED); |
| 291 agent_host = NULL; | 291 agent_host = NULL; |
| 292 CheckWorkerState(3, 2, WorkerState::WORKER_UNINSPECTED); | 292 CheckWorkerState(3, 2, WorkerState::WORKER_UNINSPECTED); |
| 293 manager_->WorkerDestroyed(3, 2); | 293 manager_->WorkerDestroyed(3, 2); |
| 294 CheckWorkerNotExist(3, 2); | 294 CheckWorkerNotExist(3, 2); |
| 295 CheckWorkerCount(0); | 295 CheckWorkerCount(0); |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace content | 298 } // namespace content |
| OLD | NEW |