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

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

Issue 8983012: Get rid of content::NavigationController in cc file and use "using" instead. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 11 months 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/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 22 matching lines...) Expand all
33 #include "content/public/browser/notification_registrar.h" 33 #include "content/public/browser/notification_registrar.h"
34 #include "content/public/browser/notification_service.h" 34 #include "content/public/browser/notification_service.h"
35 #include "content/public/browser/worker_service.h" 35 #include "content/public/browser/worker_service.h"
36 #include "content/public/browser/worker_service_observer.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::NavigationController;
43 using content::WorkerService; 44 using content::WorkerService;
44 using content::WorkerServiceObserver; 45 using content::WorkerServiceObserver;
45 46
46 namespace { 47 namespace {
47 48
48 // Used to block until a dev tools client window's browser is closed. 49 // Used to block until a dev tools client window's browser is closed.
49 class BrowserClosedObserver : public content::NotificationObserver { 50 class BrowserClosedObserver : public content::NotificationObserver {
50 public: 51 public:
51 explicit BrowserClosedObserver(Browser* browser) { 52 explicit BrowserClosedObserver(Browser* browser) {
52 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, 53 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED,
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 worker_data->worker_process_id, 406 worker_data->worker_process_id,
406 worker_data->worker_route_id); 407 worker_data->worker_route_id);
407 DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor( 408 DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(
408 agent_host, 409 agent_host,
409 window_->devtools_client_host()); 410 window_->devtools_client_host());
410 RenderViewHost* client_rvh = window_->GetRenderViewHost(); 411 RenderViewHost* client_rvh = window_->GetRenderViewHost();
411 TabContents* client_contents = client_rvh->delegate()->GetAsTabContents(); 412 TabContents* client_contents = client_rvh->delegate()->GetAsTabContents();
412 if (client_contents->IsLoading()) { 413 if (client_contents->IsLoading()) {
413 ui_test_utils::WindowedNotificationObserver observer( 414 ui_test_utils::WindowedNotificationObserver observer(
414 content::NOTIFICATION_LOAD_STOP, 415 content::NOTIFICATION_LOAD_STOP,
415 content::Source<content::NavigationController>( 416 content::Source<NavigationController>(
416 &client_contents->GetController())); 417 &client_contents->GetController()));
417 observer.Wait(); 418 observer.Wait();
418 } 419 }
419 } 420 }
420 421
421 void CloseDevToolsWindow() { 422 void CloseDevToolsWindow() {
422 Browser* browser = window_->browser(); 423 Browser* browser = window_->browser();
423 browser->CloseAllTabs(); 424 browser->CloseAllTabs();
424 BrowserClosedObserver close_observer(browser); 425 BrowserClosedObserver close_observer(browser);
425 } 426 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 #define TestReattachAfterCrash FLAKY_TestReattachAfterCrash 519 #define TestReattachAfterCrash FLAKY_TestReattachAfterCrash
519 #endif 520 #endif
520 // Tests that inspector will reattach to inspected page when it is reloaded 521 // Tests that inspector will reattach to inspected page when it is reloaded
521 // after a crash. See http://crbug.com/101952 522 // after a crash. See http://crbug.com/101952
522 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestReattachAfterCrash) { 523 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestReattachAfterCrash) {
523 OpenDevToolsWindow(kDebuggerTestPage); 524 OpenDevToolsWindow(kDebuggerTestPage);
524 525
525 ui_test_utils::CrashTab(GetInspectedTab()); 526 ui_test_utils::CrashTab(GetInspectedTab());
526 ui_test_utils::WindowedNotificationObserver observer( 527 ui_test_utils::WindowedNotificationObserver observer(
527 content::NOTIFICATION_LOAD_STOP, 528 content::NOTIFICATION_LOAD_STOP,
528 content::Source<content::NavigationController>( 529 content::Source<NavigationController>(
529 &browser()->GetSelectedTabContentsWrapper()->web_contents()-> 530 &browser()->GetSelectedTabContentsWrapper()->web_contents()->
530 GetController())); 531 GetController()));
531 browser()->Reload(CURRENT_TAB); 532 browser()->Reload(CURRENT_TAB);
532 observer.Wait(); 533 observer.Wait();
533 534
534 RunTestFunction(window_, "testReattachAfterCrash"); 535 RunTestFunction(window_, "testReattachAfterCrash");
535 CloseDevToolsWindow(); 536 CloseDevToolsWindow();
536 } 537 }
537 538
538 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPageWithNoJavaScript) { 539 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPageWithNoJavaScript) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 586
586 // Reload page to restart the worker. 587 // Reload page to restart the worker.
587 ui_test_utils::NavigateToURL(browser(), url); 588 ui_test_utils::NavigateToURL(browser(), url);
588 589
589 // Wait until worker script is paused on the debugger statement. 590 // Wait until worker script is paused on the debugger statement.
590 RunTestFunction(window_, "testPauseInSharedWorkerInitialization"); 591 RunTestFunction(window_, "testPauseInSharedWorkerInitialization");
591 CloseDevToolsWindow(); 592 CloseDevToolsWindow();
592 } 593 }
593 594
594 } // namespace 595 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/crash_recovery_browsertest.cc ('k') | chrome/browser/debugger/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698