• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "mojo/public/cpp/base/process_id_mojom_traits.h"
6 #include "mojo/public/cpp/test_support/test_utils.h"
7 #include "mojo/public/mojom/base/process_id.mojom.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 
10 namespace mojo_base {
11 namespace process_id_unittest {
12 
TEST(ProcessIdTest,ProcessId)13 TEST(ProcessIdTest, ProcessId) {
14   base::ProcessId pid = base::GetCurrentProcId();
15   base::ProcessId out_pid = base::kNullProcessId;
16   ASSERT_NE(pid, out_pid);
17   EXPECT_TRUE(mojom::ProcessId::Deserialize(mojom::ProcessId::Serialize(&pid),
18                                             &out_pid));
19   EXPECT_EQ(pid, out_pid);
20 }
21 
22 }  // namespace process_id_unittest
23 }  // namespace mojo_base