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

Unified Diff: components/browser_watcher/watcher_client_win_unittest.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Fix Mojo launcher, review comments Created 3 years, 5 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
Index: components/browser_watcher/watcher_client_win_unittest.cc
diff --git a/components/browser_watcher/watcher_client_win_unittest.cc b/components/browser_watcher/watcher_client_win_unittest.cc
index c801494e888bb2be828045fdbc1705c951826d12..953040f16c1dc167ef0573673effc12e8248001d 100644
--- a/components/browser_watcher/watcher_client_win_unittest.cc
+++ b/components/browser_watcher/watcher_client_win_unittest.cc
@@ -161,43 +161,7 @@ class WatcherClientTest : public base::MultiProcessTest {
// TODO(siggi): More testing - test WatcherClient base implementation.
TEST_F(WatcherClientTest, LaunchWatcherSucceeds) {
- // We can only use the non-legacy launch method on Windows Vista or better.
- if (base::win::GetVersion() < base::win::VERSION_VISTA)
- return;
-
WatcherClient client(GetBaseCommandLineGenerator(NO_LEAK_HANDLE));
- ASSERT_FALSE(client.use_legacy_launch());
-
- client.LaunchWatcher();
-
- ASSERT_NO_FATAL_FAILURE(
- AssertSuccessfulExitCode(client.process().Duplicate()));
-}
-
-TEST_F(WatcherClientTest, LaunchWatcherLegacyModeSucceeds) {
- // Test the XP-compatible legacy launch mode. This is expected to leak
- // a handle to the child process.
- WatcherClient client(GetBaseCommandLineGenerator(LEAK_HANDLE));
-
- // Use the legacy launch mode.
- client.set_use_legacy_launch(true);
-
- client.LaunchWatcher();
-
- ASSERT_NO_FATAL_FAILURE(
- AssertSuccessfulExitCode(client.process().Duplicate()));
-}
-
-TEST_F(WatcherClientTest, LegacyModeDetectedOnXP) {
- // This test only works on Windows XP.
- if (base::win::GetVersion() > base::win::VERSION_XP)
- return;
-
- // Test that the client detects the need to use legacy launch mode, and that
- // it works on Windows XP.
- WatcherClient client(GetBaseCommandLineGenerator(LEAK_HANDLE));
- ASSERT_TRUE(client.use_legacy_launch());
-
client.LaunchWatcher();
ASSERT_NO_FATAL_FAILURE(

Powered by Google App Engine
This is Rietveld 408576698