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

Unified Diff: chrome/browser/apps/app_browsertest.cc

Issue 462533002: Make runtime.reload() work with component extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Eliminate the ENABLED_COMPONENT state. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
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");
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service.cc » ('j') | extensions/browser/extension_prefs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698