OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2009 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 "base/sys_info.h" | |
6 #include "base/string_util.h" | |
7 #include "chrome/renderer/render_process.h" | |
8 #include "testing/gtest/include/gtest/gtest.h" | |
9 | |
10 | |
11 class RenderProcessTest : public testing::Test { | |
12 public: | |
13 virtual void SetUp() { | |
14 // Must have a message loop to create a RenderThread() | |
15 message_loop_ = new MessageLoop(MessageLoop::TYPE_DEFAULT); | |
16 } | |
17 | |
18 virtual void TearDown() { | |
19 delete message_loop_; | |
20 } | |
21 | |
22 private: | |
23 MessageLoop *message_loop_; | |
24 }; | |
25 | |
26 | |
27 TEST_F(RenderProcessTest, TestSharedMemoryAllocOne) { | |
28 RenderProcess::GlobalInit(ASCIIToWide("hi mom")); | |
29 size_t size = base::SysInfo::VMAllocationGranularity(); | |
30 base::SharedMemory *mem = RenderProcess::AllocSharedMemory(size); | |
agl
2009/01/28 01:07:53
Stars on the left.
| |
31 ASSERT_TRUE(mem); | |
32 RenderProcess::FreeSharedMemory(mem); | |
33 RenderProcess::GlobalCleanup(); | |
34 } | |
35 | |
OLD | NEW |