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

Unified Diff: apps/load_and_launch_browsertest.cc

Issue 16357005: Pass command line arguments through with --load-and-launch-app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 7 years, 6 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 | « apps/app_load_service.cc ('k') | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/load_and_launch_browsertest.cc
diff --git a/apps/load_and_launch_browsertest.cc b/apps/load_and_launch_browsertest.cc
index 63d22661c09eca1737df2a4f6b9436101f7d8010..fd0f2ddc3f23a07a338736487963578daaa4a75e 100644
--- a/apps/load_and_launch_browsertest.cc
+++ b/apps/load_and_launch_browsertest.cc
@@ -58,6 +58,49 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
process, TestTimeouts::action_timeout()));
}
+// TODO(jackhou): Enable this test once it works on OSX. It currently does not
+// work for the same reason --app-id doesn't. See http://crbug.com/148465
+#if defined(OS_MACOSX)
+#define MAYBE_LoadAndLaunchAppWithFile DISABLED_LoadAndLaunchAppWithFile
+#else
+#define MAYBE_LoadAndLaunchAppWithFile LoadAndLaunchAppWithFile
+#endif
+
+IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
+ MAYBE_LoadAndLaunchAppWithFile) {
+ ExtensionTestMessageListener launched_listener("Launched", false);
+
+ const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
+ CommandLine new_cmdline(cmdline.GetProgram());
+
+ const char* kSwitchNames[] = {
+ switches::kUserDataDir,
+ };
+ new_cmdline.CopySwitchesFrom(cmdline, kSwitchNames, arraysize(kSwitchNames));
+
+ base::FilePath app_path = test_data_dir_
+ .AppendASCII("platform_apps")
+ .AppendASCII("load_and_launch_file");
+
+ base::FilePath test_file_path = test_data_dir_
+ .AppendASCII("platform_apps")
+ .AppendASCII("launch_files")
+ .AppendASCII("test.txt");
+
+ new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp,
+ app_path.value());
+ new_cmdline.AppendSwitch(content::kLaunchAsBrowser);
+ new_cmdline.AppendArgPath(test_file_path);
+
+ base::ProcessHandle process;
+ base::LaunchProcess(new_cmdline, base::LaunchOptions(), &process);
+ ASSERT_NE(base::kNullProcessHandle, process);
+
+ ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
+ ASSERT_TRUE(base::WaitForSingleProcess(
+ process, TestTimeouts::action_timeout()));
+}
+
namespace {
// TestFixture that appends --load-and-launch-app before calling BrowserMain.
« no previous file with comments | « apps/app_load_service.cc ('k') | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698