| 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" |
| 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_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
| 16 #include "chrome/browser/extensions/unpacked_installer.h" | 16 #include "chrome/browser/extensions/unpacked_installer.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 19 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 20 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
| 21 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
| 22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 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" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 #endif | 526 #endif |
| 527 // Tests that inspector will reattach to inspected page when it is reloaded | 527 // Tests that inspector will reattach to inspected page when it is reloaded |
| 528 // after a crash. See http://crbug.com/101952 | 528 // after a crash. See http://crbug.com/101952 |
| 529 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestReattachAfterCrash) { | 529 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestReattachAfterCrash) { |
| 530 OpenDevToolsWindow(kDebuggerTestPage); | 530 OpenDevToolsWindow(kDebuggerTestPage); |
| 531 | 531 |
| 532 ui_test_utils::CrashTab(GetInspectedTab()); | 532 ui_test_utils::CrashTab(GetInspectedTab()); |
| 533 ui_test_utils::WindowedNotificationObserver observer( | 533 ui_test_utils::WindowedNotificationObserver observer( |
| 534 content::NOTIFICATION_LOAD_STOP, | 534 content::NOTIFICATION_LOAD_STOP, |
| 535 content::Source<NavigationController>( | 535 content::Source<NavigationController>( |
| 536 &browser()->GetSelectedTabContentsWrapper()->web_contents()-> | 536 &browser()->GetActiveWebContents()->GetController())); |
| 537 GetController())); | |
| 538 browser()->Reload(CURRENT_TAB); | 537 browser()->Reload(CURRENT_TAB); |
| 539 observer.Wait(); | 538 observer.Wait(); |
| 540 | 539 |
| 541 RunTestFunction(window_, "testReattachAfterCrash"); | 540 RunTestFunction(window_, "testReattachAfterCrash"); |
| 542 CloseDevToolsWindow(); | 541 CloseDevToolsWindow(); |
| 543 } | 542 } |
| 544 | 543 |
| 545 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPageWithNoJavaScript) { | 544 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPageWithNoJavaScript) { |
| 546 OpenDevToolsWindow("about:blank"); | 545 OpenDevToolsWindow("about:blank"); |
| 547 std::string result; | 546 std::string result; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 content::CONSOLE_MESSAGE_LEVEL_LOG, | 604 content::CONSOLE_MESSAGE_LEVEL_LOG, |
| 606 "log"); | 605 "log"); |
| 607 devtools_manager->AddMessageToConsole(agent_host, | 606 devtools_manager->AddMessageToConsole(agent_host, |
| 608 content::CONSOLE_MESSAGE_LEVEL_ERROR, | 607 content::CONSOLE_MESSAGE_LEVEL_ERROR, |
| 609 "error"); | 608 "error"); |
| 610 RunTestFunction(window_, "checkLogAndErrorMessages"); | 609 RunTestFunction(window_, "checkLogAndErrorMessages"); |
| 611 CloseDevToolsWindow(); | 610 CloseDevToolsWindow(); |
| 612 } | 611 } |
| 613 | 612 |
| 614 } // namespace | 613 } // namespace |
| OLD | NEW |