diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-06-11 16:24:11 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-06-11 16:24:11 +0100 |
commit | 5e3f23d412006dc4db4e659864679f29341e113f (patch) | |
tree | fb52e3eb179269ea21e0b510509ecf9e8d7b3111 /apps/load_and_launch_browsertest.cc | |
parent | a486f6ca78e90d14f48125ef943e045218aac565 (diff) | |
download | chromium_org-5e3f23d412006dc4db4e659864679f29341e113f.tar.gz |
Merge from Chromium at DEPS revision r205548
This commit was generated by merge_to_master.py.
Change-Id: I6d3c83f1b6c91aecc6bd4bf93562314356dd44b9
Diffstat (limited to 'apps/load_and_launch_browsertest.cc')
-rw-r--r-- | apps/load_and_launch_browsertest.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/apps/load_and_launch_browsertest.cc b/apps/load_and_launch_browsertest.cc index 63d22661c0..fd0f2ddc3f 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. |