OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 #include "base/gfx/rect.h" | 5 #include "base/gfx/rect.h" |
6 #include "base/sys_info.h" | 6 #include "base/sys_info.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "chrome/renderer/render_process.h" | 8 #include "chrome/renderer/render_process.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 scoped_ptr<RenderProcess> render_process_; | 37 scoped_ptr<RenderProcess> render_process_; |
38 IPC::Channel *channel_; | 38 IPC::Channel *channel_; |
39 }; | 39 }; |
40 | 40 |
41 | 41 |
42 TEST_F(RenderProcessTest, TestTransportDIBAllocation) { | 42 TEST_F(RenderProcessTest, TestTransportDIBAllocation) { |
43 // On Mac, we allocate in the browser so this test is invalid. | 43 // On Mac, we allocate in the browser so this test is invalid. |
44 #if !defined(OS_MACOSX) | 44 #if !defined(OS_MACOSX) |
45 const gfx::Rect rect(0, 0, 100, 100); | 45 const gfx::Rect rect(0, 0, 100, 100); |
46 TransportDIB* dib; | 46 TransportDIB* dib; |
47 skia::PlatformCanvas* canvas = RenderProcess::current()->GetDrawingCanvas(&dib
, rect); | 47 skia::PlatformCanvas* canvas = |
| 48 RenderProcess::current()->GetDrawingCanvas(&dib, rect); |
48 ASSERT_TRUE(dib); | 49 ASSERT_TRUE(dib); |
49 ASSERT_TRUE(canvas); | 50 ASSERT_TRUE(canvas); |
50 RenderProcess::current()->ReleaseTransportDIB(dib); | 51 RenderProcess::current()->ReleaseTransportDIB(dib); |
51 delete canvas; | 52 delete canvas; |
52 #endif | 53 #endif |
53 } | 54 } |
54 | 55 |
55 } // namespace | 56 } // namespace |
OLD | NEW |