OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
6 #include <errno.h> | 6 #include <errno.h> |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <pthread.h> | 8 #include <pthread.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "nacl_mounts/kernel_handle.h" | 14 #include "nacl_io/kernel_handle.h" |
15 #include "nacl_mounts/kernel_object.h" | 15 #include "nacl_io/kernel_object.h" |
16 #include "nacl_mounts/mount.h" | 16 #include "nacl_io/mount.h" |
17 #include "nacl_mounts/path.h" | 17 #include "nacl_io/path.h" |
18 | 18 |
19 #include "gtest/gtest.h" | 19 #include "gtest/gtest.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 class MountRefMock : public Mount { | 23 class MountRefMock : public Mount { |
24 public: | 24 public: |
25 MountRefMock(int* mount_count, int* handle_count) | 25 MountRefMock(int* mount_count, int* handle_count) |
26 : mount_count(mount_count), | 26 : mount_count(mount_count), |
27 handle_count(handle_count) { | 27 handle_count(handle_count) { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 EXPECT_EQ(1, handle_count); | 181 EXPECT_EQ(1, handle_count); |
182 EXPECT_EQ(3, handle->RefCount()); | 182 EXPECT_EQ(3, handle->RefCount()); |
183 | 183 |
184 proxy->FreeFD(0); | 184 proxy->FreeFD(0); |
185 proxy->FreeFD(2); | 185 proxy->FreeFD(2); |
186 proxy->ReleaseHandle(handle); // handle is constructed with a refcount of 1. | 186 proxy->ReleaseHandle(handle); // handle is constructed with a refcount of 1. |
187 | 187 |
188 EXPECT_EQ(0, handle_count); | 188 EXPECT_EQ(0, handle_count); |
189 } | 189 } |
OLD | NEW |