Index: chrome/browser/apps/app_browsertest.cc |
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc |
index 45aac38ebd685fdb2a371668cfe22ba7204f28d0..13b4d44c3209c482798c3dac45abe046b0126505 100644 |
--- a/chrome/browser/apps/app_browsertest.cc |
+++ b/chrome/browser/apps/app_browsertest.cc |
@@ -1051,6 +1051,37 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ComponentAppBackgroundPage) { |
ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
} |
+IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, |
+ ComponentExtensionRuntimeReload) { |
+ // Ensure that we wait until the background page is run (to register the |
+ // OnLaunched listener) before trying to open the application. This is similar |
+ // to LoadAndLaunchPlatformApp, but we want to load as a component extension. |
+ content::WindowedNotificationObserver app_loaded_observer( |
+ content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
+ content::NotificationService::AllSources()); |
+ |
+ const Extension* extension = LoadExtensionAsComponent( |
+ test_data_dir_.AppendASCII("platform_apps").AppendASCII("component")); |
+ ASSERT_TRUE(extension); |
+ |
+ app_loaded_observer.Wait(); |
+ |
+ { |
+ ExtensionTestMessageListener launched_listener("Launched", false); |
+ OpenApplication(AppLaunchParams( |
+ browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW)); |
+ ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
+ } |
+ |
+ { |
+ ASSERT_TRUE(ExecuteScriptInBackgroundPageNoWait( |
+ extension->id(), "chrome.runtime.reload();")); |
+ ExtensionTestMessageListener launched_listener("Launched", false); |
+ ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
+ } |
+} |
+ |
+ |
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Messaging) { |
ExtensionApiTest::ResultCatcher result_catcher; |
LoadAndLaunchPlatformApp("messaging/app2", "Ready"); |