| 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/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" |
| 11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
| 12 #include "base/test/test_timeouts.h" | 12 #include "base/test/test_timeouts.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/debugger/devtools_window.h" | 14 #include "chrome/browser/debugger/devtools_window.h" |
| 15 #include "chrome/browser/extensions/extension_host.h" | 15 #include "chrome/browser/extensions/extension_host.h" |
| 16 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
| 17 #include "chrome/browser/extensions/unpacked_installer.h" | 17 #include "chrome/browser/extensions/unpacked_installer.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
| 22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
| 23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/test/base/in_process_browser_test.h" | 24 #include "chrome/test/base/in_process_browser_test.h" |
| 25 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
| 26 #include "content/browser/renderer_host/render_view_host.h" | 26 #include "content/browser/renderer_host/render_view_host.h" |
| 27 #include "content/browser/tab_contents/tab_contents.h" | 27 #include "content/browser/tab_contents/tab_contents.h" |
| 28 #include "content/browser/worker_host/worker_process_host.h" | 28 #include "content/browser/worker_host/worker_process_host.h" |
| 29 #include "content/browser/worker_host/worker_service.h" | |
| 30 #include "content/browser/worker_host/worker_service_observer.h" | |
| 31 #include "content/public/browser/devtools_agent_host_registry.h" | 29 #include "content/public/browser/devtools_agent_host_registry.h" |
| 32 #include "content/public/browser/devtools_client_host.h" | 30 #include "content/public/browser/devtools_client_host.h" |
| 33 #include "content/public/browser/devtools_manager.h" | 31 #include "content/public/browser/devtools_manager.h" |
| 34 #include "content/public/browser/content_browser_client.h" | 32 #include "content/public/browser/content_browser_client.h" |
| 35 #include "content/public/browser/notification_registrar.h" | 33 #include "content/public/browser/notification_registrar.h" |
| 36 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
| 35 #include "content/public/browser/worker_service.h" |
| 36 #include "content/public/browser/worker_service_observer.h" |
| 37 #include "net/test/test_server.h" | 37 #include "net/test/test_server.h" |
| 38 | 38 |
| 39 using content::BrowserThread; | 39 using content::BrowserThread; |
| 40 using content::DevToolsManager; | 40 using content::DevToolsManager; |
| 41 using content::DevToolsAgentHost; | 41 using content::DevToolsAgentHost; |
| 42 using content::DevToolsAgentHostRegistry; | 42 using content::DevToolsAgentHostRegistry; |
| 43 using content::WorkerService; |
| 44 using content::WorkerServiceObserver; |
| 43 | 45 |
| 44 namespace { | 46 namespace { |
| 45 | 47 |
| 46 // Used to block until a dev tools client window's browser is closed. | 48 // Used to block until a dev tools client window's browser is closed. |
| 47 class BrowserClosedObserver : public content::NotificationObserver { | 49 class BrowserClosedObserver : public content::NotificationObserver { |
| 48 public: | 50 public: |
| 49 explicit BrowserClosedObserver(Browser* browser) { | 51 explicit BrowserClosedObserver(Browser* browser) { |
| 50 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, | 52 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, |
| 51 content::Source<Browser>(browser)); | 53 content::Source<Browser>(browser)); |
| 52 ui_test_utils::RunMessageLoop(); | 54 ui_test_utils::RunMessageLoop(); |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 585 |
| 584 // Reload page to restart the worker. | 586 // Reload page to restart the worker. |
| 585 ui_test_utils::NavigateToURL(browser(), url); | 587 ui_test_utils::NavigateToURL(browser(), url); |
| 586 | 588 |
| 587 // Wait until worker script is paused on the debugger statement. | 589 // Wait until worker script is paused on the debugger statement. |
| 588 RunTestFunction(window_, "testPauseInSharedWorkerInitialization"); | 590 RunTestFunction(window_, "testPauseInSharedWorkerInitialization"); |
| 589 CloseDevToolsWindow(); | 591 CloseDevToolsWindow(); |
| 590 } | 592 } |
| 591 | 593 |
| 592 } // namespace | 594 } // namespace |
| OLD | NEW |