Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: chrome/browser/debugger/devtools_sanity_unittest.cc

Issue 8417012: Refactor loading out of ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: finally Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/accessibility_util.cc ('k') | chrome/browser/download/download_crx_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698