| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 | 371 |
| 372 static void WaitForFirstSharedWorkerOnIOThread( | 372 static void WaitForFirstSharedWorkerOnIOThread( |
| 373 scoped_refptr<WorkerData> worker_data) { | 373 scoped_refptr<WorkerData> worker_data) { |
| 374 BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS); | 374 BrowserChildProcessHost::Iterator iter(ChildProcessInfo::WORKER_PROCESS); |
| 375 for (; !iter.Done(); ++iter) { | 375 for (; !iter.Done(); ++iter) { |
| 376 WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter); | 376 WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter); |
| 377 const WorkerProcessHost::Instances& instances = worker->instances(); | 377 const WorkerProcessHost::Instances& instances = worker->instances(); |
| 378 for (WorkerProcessHost::Instances::const_iterator i = instances.begin(); | 378 for (WorkerProcessHost::Instances::const_iterator i = instances.begin(); |
| 379 i != instances.end(); ++i) { | 379 i != instances.end(); ++i) { |
| 380 if (!i->shared()) | 380 |
| 381 continue; | |
| 382 worker_data->worker_process_id = worker->id(); | 381 worker_data->worker_process_id = worker->id(); |
| 383 worker_data->worker_route_id = i->worker_route_id(); | 382 worker_data->worker_route_id = i->worker_route_id(); |
| 384 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 383 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 385 new MessageLoop::QuitTask); | 384 new MessageLoop::QuitTask); |
| 386 return; | 385 return; |
| 387 } | 386 } |
| 388 } | 387 } |
| 389 | 388 |
| 390 WorkerService::GetInstance()->AddObserver( | 389 WorkerService::GetInstance()->AddObserver( |
| 391 new WorkerCreationObserver(worker_data.get())); | 390 new WorkerCreationObserver(worker_data.get())); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 | 546 |
| 548 // Reload page to restart the worker. | 547 // Reload page to restart the worker. |
| 549 ui_test_utils::NavigateToURL(browser(), url); | 548 ui_test_utils::NavigateToURL(browser(), url); |
| 550 | 549 |
| 551 // Wait until worker script is paused on the debugger statement. | 550 // Wait until worker script is paused on the debugger statement. |
| 552 RunTestFuntion(window_, "testPauseInSharedWorkerInitialization"); | 551 RunTestFuntion(window_, "testPauseInSharedWorkerInitialization"); |
| 553 CloseDevToolsWindow(); | 552 CloseDevToolsWindow(); |
| 554 } | 553 } |
| 555 | 554 |
| 556 } // namespace | 555 } // namespace |
| OLD | NEW |