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

Unified Diff: base/process_util_unittest.cc

Issue 9283009: Adding GetProcId unittest (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_unittest.cc
===================================================================
--- base/process_util_unittest.cc (revision 118800)
+++ base/process_util_unittest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -172,6 +172,20 @@
remove(kSignalFileSlow);
}
+#if defined(OS_WIN)
+// TODO(cpu): figure out how to test this in other platforms.
+TEST_F(ProcessUtilTest, GetProcId) {
+ base::ProcessId id1 = base::GetProcId(GetCurrentProcess());
+ EXPECT_NE(0ul, id1);
+ base::ProcessHandle handle = this->SpawnChild("SimpleChildProcess", false);
+ ASSERT_NE(base::kNullProcessHandle, handle);
+ base::ProcessId id2 = base::GetProcId(handle);
+ EXPECT_NE(0ul, id2);
+ EXPECT_NE(id1, id2);
+ base::CloseProcessHandle(handle);
+}
+#endif
+
#if !defined(OS_MACOSX)
// This test is disabled on Mac, since it's flaky due to ReportCrash
// taking a variable amount of time to parse and load the debug and
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698