OLD | NEW |
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 // Tests for the --load-and-launch-app switch. | 5 // Tests for the --load-and-launch-app switch. |
6 // The two cases are when chrome is running and another process uses the switch | 6 // The two cases are when chrome is running and another process uses the switch |
7 // and when chrome is started from scratch. | 7 // and when chrome is started from scratch. |
8 | 8 |
9 #include "apps/switches.h" | 9 #include "apps/switches.h" |
10 #include "base/process/launch.h" | 10 #include "base/process/launch.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 base::FilePath app_path = test_data_dir_ | 45 base::FilePath app_path = test_data_dir_ |
46 .AppendASCII("platform_apps") | 46 .AppendASCII("platform_apps") |
47 .AppendASCII("minimal"); | 47 .AppendASCII("minimal"); |
48 | 48 |
49 new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp, | 49 new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp, |
50 app_path.value()); | 50 app_path.value()); |
51 | 51 |
52 new_cmdline.AppendSwitch(content::kLaunchAsBrowser); | 52 new_cmdline.AppendSwitch(content::kLaunchAsBrowser); |
53 base::ProcessHandle process; | 53 base::ProcessHandle process; |
54 base::LaunchProcess(new_cmdline, base::LaunchOptions(), &process); | 54 base::LaunchProcess(new_cmdline, base::LaunchOptionsForTest(), &process); |
55 ASSERT_NE(base::kNullProcessHandle, process); | 55 ASSERT_NE(base::kNullProcessHandle, process); |
56 | 56 |
57 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 57 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
58 ASSERT_TRUE(base::WaitForSingleProcess( | 58 ASSERT_TRUE(base::WaitForSingleProcess( |
59 process, TestTimeouts::action_timeout())); | 59 process, TestTimeouts::action_timeout())); |
60 } | 60 } |
61 | 61 |
62 // TODO(jackhou): Enable this test once it works on OSX. It currently does not | 62 // TODO(jackhou): Enable this test once it works on OSX. It currently does not |
63 // work for the same reason --app-id doesn't. See http://crbug.com/148465 | 63 // work for the same reason --app-id doesn't. See http://crbug.com/148465 |
64 #if defined(OS_MACOSX) | 64 #if defined(OS_MACOSX) |
(...skipping 22 matching lines...) Expand all Loading... |
87 .AppendASCII("platform_apps") | 87 .AppendASCII("platform_apps") |
88 .AppendASCII("launch_files") | 88 .AppendASCII("launch_files") |
89 .AppendASCII("test.txt"); | 89 .AppendASCII("test.txt"); |
90 | 90 |
91 new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp, | 91 new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp, |
92 app_path.value()); | 92 app_path.value()); |
93 new_cmdline.AppendSwitch(content::kLaunchAsBrowser); | 93 new_cmdline.AppendSwitch(content::kLaunchAsBrowser); |
94 new_cmdline.AppendArgPath(test_file_path); | 94 new_cmdline.AppendArgPath(test_file_path); |
95 | 95 |
96 base::ProcessHandle process; | 96 base::ProcessHandle process; |
97 base::LaunchProcess(new_cmdline, base::LaunchOptions(), &process); | 97 base::LaunchProcess(new_cmdline, base::LaunchOptionsForTest(), &process); |
98 ASSERT_NE(base::kNullProcessHandle, process); | 98 ASSERT_NE(base::kNullProcessHandle, process); |
99 | 99 |
100 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 100 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
101 ASSERT_TRUE(base::WaitForSingleProcess( | 101 ASSERT_TRUE(base::WaitForSingleProcess( |
102 process, TestTimeouts::action_timeout())); | 102 process, TestTimeouts::action_timeout())); |
103 } | 103 } |
104 | 104 |
105 namespace { | 105 namespace { |
106 | 106 |
107 // TestFixture that appends --load-and-launch-app before calling BrowserMain. | 107 // TestFixture that appends --load-and-launch-app before calling BrowserMain. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 LoadAndLaunchAppChromeNotRunning | 146 LoadAndLaunchAppChromeNotRunning |
147 #endif | 147 #endif |
148 | 148 |
149 // Case where Chrome is not running. | 149 // Case where Chrome is not running. |
150 IN_PROC_BROWSER_TEST_F(PlatformAppLoadAndLaunchBrowserTest, | 150 IN_PROC_BROWSER_TEST_F(PlatformAppLoadAndLaunchBrowserTest, |
151 MAYBE_LoadAndLaunchAppChromeNotRunning) { | 151 MAYBE_LoadAndLaunchAppChromeNotRunning) { |
152 LoadAndLaunchApp(); | 152 LoadAndLaunchApp(); |
153 } | 153 } |
154 | 154 |
155 } // namespace apps | 155 } // namespace apps |
OLD | NEW |