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

Side by Side Diff: apps/load_and_launch_browsertest.cc

Issue 938453002: Remove base::WaitForSingleProcess (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | base/debug/stack_trace_unittest.cc » ('j') | base/process/kill_win.cc » ('J')
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 // 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp, 56 new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp,
57 app_path.value()); 57 app_path.value());
58 58
59 new_cmdline.AppendSwitch(content::kLaunchAsBrowser); 59 new_cmdline.AppendSwitch(content::kLaunchAsBrowser);
60 base::Process process = 60 base::Process process =
61 base::LaunchProcess(new_cmdline, base::LaunchOptionsForTest()); 61 base::LaunchProcess(new_cmdline, base::LaunchOptionsForTest());
62 ASSERT_TRUE(process.IsValid()); 62 ASSERT_TRUE(process.IsValid());
63 63
64 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); 64 ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
65 ASSERT_TRUE(base::WaitForSingleProcess(process.Handle(), 65 int exit_code;
66 TestTimeouts::action_timeout())); 66 ASSERT_TRUE(process.WaitForExitWithTimeout(TestTimeouts::action_timeout(),
67 &exit_code));
67 } 68 }
68 69
69 // TODO(jackhou): Enable this test once it works on OSX. It currently does not 70 // TODO(jackhou): Enable this test once it works on OSX. It currently does not
70 // work for the same reason --app-id doesn't. See http://crbug.com/148465 71 // work for the same reason --app-id doesn't. See http://crbug.com/148465
71 #if defined(OS_MACOSX) 72 #if defined(OS_MACOSX)
72 #define MAYBE_LoadAndLaunchAppWithFile DISABLED_LoadAndLaunchAppWithFile 73 #define MAYBE_LoadAndLaunchAppWithFile DISABLED_LoadAndLaunchAppWithFile
73 #else 74 #else
74 #define MAYBE_LoadAndLaunchAppWithFile LoadAndLaunchAppWithFile 75 #define MAYBE_LoadAndLaunchAppWithFile LoadAndLaunchAppWithFile
75 #endif 76 #endif
76 77
(...skipping 18 matching lines...) Expand all
95 new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp, 96 new_cmdline.AppendSwitchNative(apps::kLoadAndLaunchApp,
96 app_path.value()); 97 app_path.value());
97 new_cmdline.AppendSwitch(content::kLaunchAsBrowser); 98 new_cmdline.AppendSwitch(content::kLaunchAsBrowser);
98 new_cmdline.AppendArgPath(test_file_path); 99 new_cmdline.AppendArgPath(test_file_path);
99 100
100 base::Process process = 101 base::Process process =
101 base::LaunchProcess(new_cmdline, base::LaunchOptionsForTest()); 102 base::LaunchProcess(new_cmdline, base::LaunchOptionsForTest());
102 ASSERT_TRUE(process.IsValid()); 103 ASSERT_TRUE(process.IsValid());
103 104
104 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); 105 ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
105 ASSERT_TRUE(base::WaitForSingleProcess(process.Handle(), 106 int exit_code;
106 TestTimeouts::action_timeout())); 107 ASSERT_TRUE(process.WaitForExitWithTimeout(TestTimeouts::action_timeout(),
108 &exit_code));
107 } 109 }
108 110
109 namespace { 111 namespace {
110 112
111 // TestFixture that appends --load-and-launch-app before calling BrowserMain. 113 // TestFixture that appends --load-and-launch-app before calling BrowserMain.
112 class PlatformAppLoadAndLaunchBrowserTest : public PlatformAppBrowserTest { 114 class PlatformAppLoadAndLaunchBrowserTest : public PlatformAppBrowserTest {
113 protected: 115 protected:
114 PlatformAppLoadAndLaunchBrowserTest() {} 116 PlatformAppLoadAndLaunchBrowserTest() {}
115 117
116 void SetUpCommandLine(base::CommandLine* command_line) override { 118 void SetUpCommandLine(base::CommandLine* command_line) override {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 LoadAndLaunchAppChromeNotRunning 152 LoadAndLaunchAppChromeNotRunning
151 #endif 153 #endif
152 154
153 // Case where Chrome is not running. 155 // Case where Chrome is not running.
154 IN_PROC_BROWSER_TEST_F(PlatformAppLoadAndLaunchBrowserTest, 156 IN_PROC_BROWSER_TEST_F(PlatformAppLoadAndLaunchBrowserTest,
155 MAYBE_LoadAndLaunchAppChromeNotRunning) { 157 MAYBE_LoadAndLaunchAppChromeNotRunning) {
156 LoadAndLaunchApp(); 158 LoadAndLaunchApp();
157 } 159 }
158 160
159 } // namespace apps 161 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | base/debug/stack_trace_unittest.cc » ('j') | base/process/kill_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698