| 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" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/debugger/devtools_window.h" | 12 #include "chrome/browser/debugger/devtools_window.h" |
| 13 #include "chrome/browser/extensions/extension_host.h" | 13 #include "chrome/browser/extensions/extension_host.h" |
| 14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/extensions/unpacked_installer.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 19 #include "chrome/test/base/in_process_browser_test.h" | 20 #include "chrome/test/base/in_process_browser_test.h" |
| 20 #include "chrome/test/base/ui_test_utils.h" | 21 #include "chrome/test/base/ui_test_utils.h" |
| 21 #include "content/browser/debugger/devtools_client_host.h" | 22 #include "content/browser/debugger/devtools_client_host.h" |
| 22 #include "content/browser/debugger/devtools_manager.h" | 23 #include "content/browser/debugger/devtools_manager.h" |
| 23 #include "content/browser/debugger/worker_devtools_manager.h" | 24 #include "content/browser/debugger/worker_devtools_manager.h" |
| 24 #include "content/browser/renderer_host/render_view_host.h" | 25 #include "content/browser/renderer_host/render_view_host.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 ExtensionService* service = browser()->profile()->GetExtensionService(); | 203 ExtensionService* service = browser()->profile()->GetExtensionService(); |
| 203 size_t num_before = service->extensions()->size(); | 204 size_t num_before = service->extensions()->size(); |
| 204 { | 205 { |
| 205 content::NotificationRegistrar registrar; | 206 content::NotificationRegistrar registrar; |
| 206 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 207 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 207 content::NotificationService::AllSources()); | 208 content::NotificationService::AllSources()); |
| 208 CancelableQuitTask* delayed_quit = | 209 CancelableQuitTask* delayed_quit = |
| 209 new CancelableQuitTask("Extension load timed out."); | 210 new CancelableQuitTask("Extension load timed out."); |
| 210 MessageLoop::current()->PostDelayedTask(FROM_HERE, delayed_quit, | 211 MessageLoop::current()->PostDelayedTask(FROM_HERE, delayed_quit, |
| 211 4*1000); | 212 4*1000); |
| 212 service->LoadExtension(path); | 213 extensions::UnpackedInstaller::Create(service)->Load(path); |
| 213 ui_test_utils::RunMessageLoop(); | 214 ui_test_utils::RunMessageLoop(); |
| 214 delayed_quit->cancel(); | 215 delayed_quit->cancel(); |
| 215 } | 216 } |
| 216 size_t num_after = service->extensions()->size(); | 217 size_t num_after = service->extensions()->size(); |
| 217 if (num_after != (num_before + 1)) | 218 if (num_after != (num_before + 1)) |
| 218 return false; | 219 return false; |
| 219 | 220 |
| 220 return WaitForExtensionHostsToLoad(); | 221 return WaitForExtensionHostsToLoad(); |
| 221 } | 222 } |
| 222 | 223 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 | 547 |
| 547 // Reload page to restart the worker. | 548 // Reload page to restart the worker. |
| 548 ui_test_utils::NavigateToURL(browser(), url); | 549 ui_test_utils::NavigateToURL(browser(), url); |
| 549 | 550 |
| 550 // Wait until worker script is paused on the debugger statement. | 551 // Wait until worker script is paused on the debugger statement. |
| 551 RunTestFuntion(window_, "testPauseInSharedWorkerInitialization"); | 552 RunTestFuntion(window_, "testPauseInSharedWorkerInitialization"); |
| 552 CloseDevToolsWindow(); | 553 CloseDevToolsWindow(); |
| 553 } | 554 } |
| 554 | 555 |
| 555 } // namespace | 556 } // namespace |
| OLD | NEW |