OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cancelable_callback.h" | 6 #include "base/cancelable_callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "chrome/test/base/in_process_browser_test.h" | 23 #include "chrome/test/base/in_process_browser_test.h" |
24 #include "chrome/test/base/ui_test_utils.h" | 24 #include "chrome/test/base/ui_test_utils.h" |
25 #include "content/public/browser/child_process_data.h" | 25 #include "content/public/browser/child_process_data.h" |
26 #include "content/public/browser/content_browser_client.h" | 26 #include "content/public/browser/content_browser_client.h" |
27 #include "content/public/browser/devtools_agent_host_registry.h" | 27 #include "content/public/browser/devtools_agent_host_registry.h" |
28 #include "content/public/browser/devtools_client_host.h" | 28 #include "content/public/browser/devtools_client_host.h" |
29 #include "content/public/browser/devtools_manager.h" | 29 #include "content/public/browser/devtools_manager.h" |
30 #include "content/public/browser/notification_registrar.h" | 30 #include "content/public/browser/notification_registrar.h" |
31 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
32 #include "content/public/browser/render_view_host.h" | 32 #include "content/public/browser/render_view_host.h" |
33 #include "content/public/browser/render_view_host_delegate.h" | |
34 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
35 #include "content/public/browser/worker_service.h" | 34 #include "content/public/browser/worker_service.h" |
36 #include "content/public/browser/worker_service_observer.h" | 35 #include "content/public/browser/worker_service_observer.h" |
37 #include "net/test/test_server.h" | 36 #include "net/test/test_server.h" |
38 | 37 |
39 using content::BrowserThread; | 38 using content::BrowserThread; |
40 using content::DevToolsManager; | 39 using content::DevToolsManager; |
41 using content::DevToolsAgentHost; | 40 using content::DevToolsAgentHost; |
42 using content::DevToolsAgentHostRegistry; | 41 using content::DevToolsAgentHostRegistry; |
43 using content::NavigationController; | 42 using content::NavigationController; |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 window_ = DevToolsWindow::CreateDevToolsWindowForWorker(profile); | 386 window_ = DevToolsWindow::CreateDevToolsWindowForWorker(profile); |
388 window_->Show(DEVTOOLS_TOGGLE_ACTION_NONE); | 387 window_->Show(DEVTOOLS_TOGGLE_ACTION_NONE); |
389 DevToolsAgentHost* agent_host = | 388 DevToolsAgentHost* agent_host = |
390 DevToolsAgentHostRegistry::GetDevToolsAgentHostForWorker( | 389 DevToolsAgentHostRegistry::GetDevToolsAgentHostForWorker( |
391 worker_data->worker_process_id, | 390 worker_data->worker_process_id, |
392 worker_data->worker_route_id); | 391 worker_data->worker_route_id); |
393 DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor( | 392 DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor( |
394 agent_host, | 393 agent_host, |
395 window_->devtools_client_host()); | 394 window_->devtools_client_host()); |
396 RenderViewHost* client_rvh = window_->GetRenderViewHost(); | 395 RenderViewHost* client_rvh = window_->GetRenderViewHost(); |
397 WebContents* client_contents = | 396 WebContents* client_contents = WebContents::FromRenderViewHost(client_rvh); |
398 client_rvh->GetDelegate()->GetAsWebContents(); | |
399 if (client_contents->IsLoading()) { | 397 if (client_contents->IsLoading()) { |
400 ui_test_utils::WindowedNotificationObserver observer( | 398 ui_test_utils::WindowedNotificationObserver observer( |
401 content::NOTIFICATION_LOAD_STOP, | 399 content::NOTIFICATION_LOAD_STOP, |
402 content::Source<NavigationController>( | 400 content::Source<NavigationController>( |
403 &client_contents->GetController())); | 401 &client_contents->GetController())); |
404 observer.Wait(); | 402 observer.Wait(); |
405 } | 403 } |
406 } | 404 } |
407 | 405 |
408 void CloseDevToolsWindow() { | 406 void CloseDevToolsWindow() { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 content::CONSOLE_MESSAGE_LEVEL_LOG, | 605 content::CONSOLE_MESSAGE_LEVEL_LOG, |
608 "log"); | 606 "log"); |
609 devtools_manager->AddMessageToConsole(agent_host, | 607 devtools_manager->AddMessageToConsole(agent_host, |
610 content::CONSOLE_MESSAGE_LEVEL_ERROR, | 608 content::CONSOLE_MESSAGE_LEVEL_ERROR, |
611 "error"); | 609 "error"); |
612 RunTestFunction(window_, "checkLogAndErrorMessages"); | 610 RunTestFunction(window_, "checkLogAndErrorMessages"); |
613 CloseDevToolsWindow(); | 611 CloseDevToolsWindow(); |
614 } | 612 } |
615 | 613 |
616 } // namespace | 614 } // namespace |
OLD | NEW |