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

Side by Side Diff: chrome/browser/apps/app_browsertest.cc

Issue 589223003: Deflake ComponentExtensionRuntimeReload test and re-enable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/launcher.h" 5 #include "apps/launcher.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/files/file_util.h" 8 #include "base/files/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 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 app_loaded_observer.Wait(); 1045 app_loaded_observer.Wait();
1046 ASSERT_TRUE(should_install.seen()); 1046 ASSERT_TRUE(should_install.seen());
1047 1047
1048 ExtensionTestMessageListener launched_listener("Launched", false); 1048 ExtensionTestMessageListener launched_listener("Launched", false);
1049 OpenApplication(AppLaunchParams( 1049 OpenApplication(AppLaunchParams(
1050 browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW)); 1050 browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW));
1051 1051
1052 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); 1052 ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
1053 } 1053 }
1054 1054
1055 // Flaky: http://crbug.com/407409 1055 // Flaky: http://crbug.com/407409
tapted 2014/09/23 00:16:33 This can be removed, or replaced with a brief desc
Anand Mistry (off Chromium) 2014/09/23 00:25:43 Removed. No longer relevant.
1056 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, 1056 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
1057 DISABLED_ComponentExtensionRuntimeReload) { 1057 ComponentExtensionRuntimeReload) {
1058 // Ensure that we wait until the background page is run (to register the 1058 // Ensure that we wait until the background page is run (to register the
1059 // OnLaunched listener) before trying to open the application. This is similar 1059 // OnLaunched listener) before trying to open the application. This is similar
1060 // to LoadAndLaunchPlatformApp, but we want to load as a component extension. 1060 // to LoadAndLaunchPlatformApp, but we want to load as a component extension.
1061 content::WindowedNotificationObserver app_loaded_observer( 1061 content::WindowedNotificationObserver app_loaded_observer(
1062 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 1062 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
1063 content::NotificationService::AllSources()); 1063 content::NotificationService::AllSources());
1064 1064
1065 const Extension* extension = LoadExtensionAsComponent( 1065 const Extension* extension = LoadExtensionAsComponent(
1066 test_data_dir_.AppendASCII("platform_apps").AppendASCII("component")); 1066 test_data_dir_.AppendASCII("platform_apps").AppendASCII("component"));
1067 ASSERT_TRUE(extension); 1067 ASSERT_TRUE(extension);
1068 1068
1069 app_loaded_observer.Wait(); 1069 app_loaded_observer.Wait();
1070 1070
1071 { 1071 {
1072 ExtensionTestMessageListener launched_listener("Launched", false); 1072 ExtensionTestMessageListener launched_listener("Launched", false);
1073 OpenApplication(AppLaunchParams( 1073 OpenApplication(AppLaunchParams(
1074 browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW)); 1074 browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW));
1075 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); 1075 ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
1076 } 1076 }
1077 1077
1078 { 1078 {
1079 ASSERT_TRUE(ExecuteScriptInBackgroundPageNoWait( 1079 ASSERT_TRUE(ExecuteScriptInBackgroundPageNoWait(
1080 extension->id(), "chrome.runtime.reload();")); 1080 extension->id(),
1081 // NoWait actually waits for a domAutomationController.send() which is
1082 // implicitly append to the script. Since reload() restarts the
1083 // extension, the send after reload may not get executed. To get around
1084 // this, send first, then execute the reload().
1085 "window.domAutomationController.send(0);"
1086 "chrome.runtime.reload();"));
1081 ExtensionTestMessageListener launched_listener("Launched", false); 1087 ExtensionTestMessageListener launched_listener("Launched", false);
tapted 2014/09/23 00:16:33 should this come before the ExecuteScript? Otherwi
Anand Mistry (off Chromium) 2014/09/23 00:25:43 Done.
tapted 2014/09/23 00:48:00 (actually I realised after I sent this that a slee
1082 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); 1088 ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
1083 } 1089 }
1084 } 1090 }
1085 1091
1086 // Fails on Win7. http://crbug.com/171450 1092 // Fails on Win7. http://crbug.com/171450
1087 #if defined(OS_WIN) 1093 #if defined(OS_WIN)
1088 #define MAYBE_Messaging DISABLED_Messaging 1094 #define MAYBE_Messaging DISABLED_Messaging
1089 #else 1095 #else
1090 #define MAYBE_Messaging Messaging 1096 #define MAYBE_Messaging Messaging
1091 #endif 1097 #endif
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 LoadAndLaunchPlatformApp("reinstall_data_cleanup", "Launched"); 1328 LoadAndLaunchPlatformApp("reinstall_data_cleanup", "Launched");
1323 ASSERT_TRUE(extension); 1329 ASSERT_TRUE(extension);
1324 ASSERT_EQ(extension_id, extension->id()); 1330 ASSERT_EQ(extension_id, extension->id());
1325 1331
1326 ResultCatcher result_catcher; 1332 ResultCatcher result_catcher;
1327 EXPECT_TRUE(result_catcher.GetNextResult()); 1333 EXPECT_TRUE(result_catcher.GetNextResult());
1328 } 1334 }
1329 } 1335 }
1330 1336
1331 } // namespace extensions 1337 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698