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

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: Fix comment. 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/app_browsertest.cc
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc
index 3121246d3198418ab465782cc5db4f4fada0519a..cc78c10a050c8ce8b4a04b2f042ad19323d86fde 100644
--- a/chrome/browser/apps/app_browsertest.cc
+++ b/chrome/browser/apps/app_browsertest.cc
@@ -1051,6 +1051,36 @@ 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());
+ }
+}
+
// Fails on Win7. http://crbug.com/171450
#if defined(OS_WIN)
#define MAYBE_Messaging DISABLED_Messaging
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698