| 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/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" |
| 7 #include "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/automation/automation_util.h" | 10 #include "chrome/browser/automation/automation_util.h" |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 extension_prefs->SetExtensionRunning(extension->id(), true); | 691 extension_prefs->SetExtensionRunning(extension->id(), true); |
| 692 | 692 |
| 693 ExtensionTestMessageListener restart_listener("onRestarted", false); | 693 ExtensionTestMessageListener restart_listener("onRestarted", false); |
| 694 AppRestoreServiceFactory::GetForProfile(browser()->profile())-> | 694 AppRestoreServiceFactory::GetForProfile(browser()->profile())-> |
| 695 HandleStartup(true); | 695 HandleStartup(true); |
| 696 restart_listener.WaitUntilSatisfied(); | 696 restart_listener.WaitUntilSatisfied(); |
| 697 CloseShellWindowsAndWaitForAppToExit(); | 697 CloseShellWindowsAndWaitForAppToExit(); |
| 698 } | 698 } |
| 699 | 699 |
| 700 // Tests that relaunching an app with devtools open reopens devtools. | 700 // Tests that relaunching an app with devtools open reopens devtools. |
| 701 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, DevToolsOpenedWithReload) { | 701 #ifdef NDEBUG |
| 702 #define MAYBE_DevToolsOpenedWithReload DevToolsOpenedWithReload |
| 703 #else |
| 704 // This is currently expected to fail in debug builds due to a segfault in |
| 705 // WebKit triggered by a dereference between #ifndef NDEBUG guards see |
| 706 // http://crbug.com/157097 . |
| 707 // The test is disabled because of timeouts, see http://crbug.com/158283. |
| 708 #define MAYBE_DevToolsOpenedWithReload DISABLED_DevToolsOpenedWithReload |
| 709 #endif |
| 710 |
| 711 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_DevToolsOpenedWithReload) { |
| 702 using content::DevToolsAgentHostRegistry; | 712 using content::DevToolsAgentHostRegistry; |
| 703 | 713 |
| 704 ExtensionTestMessageListener launched_listener("Launched", false); | 714 ExtensionTestMessageListener launched_listener("Launched", false); |
| 705 const Extension* extension = LoadAndLaunchPlatformApp("minimal_id"); | 715 const Extension* extension = LoadAndLaunchPlatformApp("minimal_id"); |
| 706 ASSERT_TRUE(extension); | 716 ASSERT_TRUE(extension); |
| 707 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 717 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 708 ShellWindow* window = GetFirstShellWindow(); | 718 ShellWindow* window = GetFirstShellWindow(); |
| 709 ASSERT_TRUE(window); | 719 ASSERT_TRUE(window); |
| 710 content::RenderViewHost* rvh = window->web_contents()->GetRenderViewHost(); | 720 content::RenderViewHost* rvh = window->web_contents()->GetRenderViewHost(); |
| 711 ASSERT_TRUE(rvh); | 721 ASSERT_TRUE(rvh); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 736 ASSERT_TRUE(window); | 746 ASSERT_TRUE(window); |
| 737 | 747 |
| 738 // DevTools should have reopened with the relaunch. | 748 // DevTools should have reopened with the relaunch. |
| 739 rvh = window->web_contents()->GetRenderViewHost(); | 749 rvh = window->web_contents()->GetRenderViewHost(); |
| 740 ASSERT_TRUE(rvh); | 750 ASSERT_TRUE(rvh); |
| 741 ASSERT_TRUE(DevToolsAgentHostRegistry::HasDevToolsAgentHost(rvh)); | 751 ASSERT_TRUE(DevToolsAgentHostRegistry::HasDevToolsAgentHost(rvh)); |
| 742 CloseShellWindowsAndWaitForAppToExit(); | 752 CloseShellWindowsAndWaitForAppToExit(); |
| 743 } | 753 } |
| 744 | 754 |
| 745 } // namespace extensions | 755 } // namespace extensions |
| OLD | NEW |