From e352743f0202a4e464b83e52cda11a8c8b5dd69b Mon Sep 17 00:00:00 2001 From: rvargas Date: Tue, 9 Dec 2014 17:17:56 -0800 Subject: [PATCH] Update browser/sync to use the new version of LaunchProcess. BUG=417532 Review URL: https://codereview.chromium.org/793443002 Cr-Commit-Position: refs/heads/master@{#307608} --- chrome/browser/sync/test/integration/sync_test.cc | 13 ++++++------- chrome/browser/sync/test/integration/sync_test.h | 3 ++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 541c371847f9..4ebe2361c86e 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -176,8 +176,7 @@ SyncTest::SyncTest(TestType test_type) server_type_(SERVER_TYPE_UNDECIDED), num_clients_(-1), use_verifier_(true), - notifications_enabled_(true), - test_server_handle_(base::kNullProcessHandle) { + notifications_enabled_(true) { sync_datatype_helper::AssociateWithTest(this); switch (test_type_) { case SINGLE_CLIENT: @@ -786,7 +785,8 @@ bool SyncTest::SetUpLocalTestServer() { #if defined(OS_WIN) options.start_hidden = true; #endif - if (!base::LaunchProcess(server_cmdline, options, &test_server_handle_)) + test_server_ = base::LaunchProcess(server_cmdline, options); + if (!test_server_.IsValid()) LOG(ERROR) << "Could not launch local test server."; const base::TimeDelta kMaxWaitTime = TestTimeouts::action_max_timeout(); @@ -812,11 +812,10 @@ bool SyncTest::TearDownLocalPythonTestServer() { } bool SyncTest::TearDownLocalTestServer() { - if (test_server_handle_ != base::kNullProcessHandle) { - EXPECT_TRUE(base::KillProcess(test_server_handle_, 0, false)) + if (test_server_.IsValid()) { + EXPECT_TRUE(base::KillProcess(test_server_.Handle(), 0, false)) << "Could not stop local test server."; - base::CloseProcessHandle(test_server_handle_); - test_server_handle_ = base::kNullProcessHandle; + test_server_.Close(); } return true; } diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h index fec25ef51c25..3aea730b4089 100644 --- a/chrome/browser/sync/test/integration/sync_test.h +++ b/chrome/browser/sync/test/integration/sync_test.h @@ -12,6 +12,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" +#include "base/process/process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/test/base/in_process_browser_test.h" #include "net/dns/mock_host_resolver.h" @@ -387,7 +388,7 @@ class SyncTest : public InProcessBrowserTest { scoped_ptr mock_host_resolver_override_; // Used to start and stop the local test server. - base::ProcessHandle test_server_handle_; + base::Process test_server_; // Fake URLFetcher factory used to mock out GAIA signin. scoped_ptr fake_factory_; -- 2.11.4.GIT