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 "apps/shell_window.h" | 5 #include "apps/shell_window.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/extensions/extension_test_message_listener.h" | 27 #include "chrome/browser/extensions/extension_test_message_listener.h" |
28 #include "chrome/browser/extensions/platform_app_browsertest_util.h" | 28 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
29 #include "chrome/browser/extensions/platform_app_launcher.h" | 29 #include "chrome/browser/extensions/platform_app_launcher.h" |
30 #include "chrome/browser/extensions/shell_window_registry.h" | 30 #include "chrome/browser/extensions/shell_window_registry.h" |
31 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 31 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
32 #include "chrome/browser/ui/browser.h" | 32 #include "chrome/browser/ui/browser.h" |
33 #include "chrome/browser/ui/extensions/application_launch.h" | 33 #include "chrome/browser/ui/extensions/application_launch.h" |
34 #include "chrome/browser/ui/extensions/native_app_window.h" | 34 #include "chrome/browser/ui/extensions/native_app_window.h" |
35 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 35 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
36 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
37 #include "chrome/common/pref_names.h" | |
38 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
39 #include "chrome/test/base/test_switches.h" | 38 #include "chrome/test/base/test_switches.h" |
40 #include "chrome/test/base/ui_test_utils.h" | 39 #include "chrome/test/base/ui_test_utils.h" |
41 #include "components/user_prefs/pref_registry_syncable.h" | 40 #include "components/user_prefs/pref_registry_syncable.h" |
42 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 41 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
43 #include "content/public/browser/devtools_agent_host.h" | 42 #include "content/public/browser/devtools_agent_host.h" |
44 #include "content/public/browser/render_process_host.h" | 43 #include "content/public/browser/render_process_host.h" |
45 #include "content/public/browser/render_widget_host_view.h" | 44 #include "content/public/browser/render_widget_host_view.h" |
46 #include "content/public/browser/web_contents_view.h" | 45 #include "content/public/browser/web_contents_view.h" |
47 #include "content/public/test/test_utils.h" | 46 #include "content/public/test/test_utils.h" |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 chrome::AppLaunchParams params(incognito_profile, file_manager, 0); | 1076 chrome::AppLaunchParams params(incognito_profile, file_manager, 0); |
1078 chrome::OpenApplication(params); | 1077 chrome::OpenApplication(params); |
1079 | 1078 |
1080 while (!ContainsKey(opener_app_ids_, file_manager->id())) { | 1079 while (!ContainsKey(opener_app_ids_, file_manager->id())) { |
1081 content::RunAllPendingInMessageLoop(); | 1080 content::RunAllPendingInMessageLoop(); |
1082 } | 1081 } |
1083 } | 1082 } |
1084 | 1083 |
1085 #endif // defined(OS_CHROMEOS) | 1084 #endif // defined(OS_CHROMEOS) |
1086 | 1085 |
1087 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, DontCrashWhenReloading) { | |
1088 // Regression test for http://crbug.com/174250 | |
1089 browser()->profile()->GetPrefs()->SetBoolean( | |
1090 prefs::kExtensionsUIDeveloperMode, true); | |
1091 ui_test_utils::NavigateToURL(browser(), GURL("chrome://extensions")); | |
1092 ExtensionTestMessageListener launched_listener("Launched", true); | |
1093 const Extension* extension = LoadAndLaunchPlatformApp("reload"); | |
1094 ASSERT_TRUE(extension); | |
1095 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | |
1096 ASSERT_TRUE(GetFirstShellWindow()); | |
1097 | |
1098 // Now tell the app to reload itself. | |
1099 ExtensionTestMessageListener launched_listener2("Launched", false); | |
1100 launched_listener.Reply("reload"); | |
1101 ASSERT_TRUE(launched_listener2.WaitUntilSatisfied()); | |
1102 ASSERT_TRUE(GetFirstShellWindow()); | |
1103 } | |
1104 | 1086 |
1105 } // namespace extensions | 1087 } // namespace extensions |
OLD | NEW |