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

Side by Side Diff: chrome/renderer/render_process_unittest.cc

Issue 155876: Revert r21117 as it caused reliability failures.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_process.cc ('k') | chrome/renderer/render_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 namespace { 11 namespace {
12 12
13 static const char kThreadName[] = "render_process_unittest"; 13 static const char kThreadName[] = "render_process_unittest";
14 14
15 class RenderProcessTest : public testing::Test { 15 class RenderProcessTest : public testing::Test {
16 public: 16 public:
17 virtual void SetUp() { 17 virtual void SetUp() {
18 // Need a MODE_SERVER to make MODE_CLIENTs (like a RenderThread) happy. 18 // Need a MODE_SERVER to make MODE_CLIENTs (like a RenderThread) happy.
19 channel_ = new IPC::Channel(kThreadName, IPC::Channel::MODE_SERVER, NULL); 19 channel_ = new IPC::Channel(kThreadName, IPC::Channel::MODE_SERVER, NULL);
20 render_process_.reset(new RenderProcess()); 20 render_process_.reset(new RenderProcess(kThreadName));
21 } 21 }
22 22
23 virtual void TearDown() { 23 virtual void TearDown() {
24 message_loop_.RunAllPending(); 24 message_loop_.RunAllPending();
25 render_process_.reset(); 25 render_process_.reset();
26 // Need to fully destruct IPC::SyncChannel before the message loop goes 26 // Need to fully destruct IPC::SyncChannel before the message loop goes
27 // away. 27 // away.
28 message_loop_.RunAllPending(); 28 message_loop_.RunAllPending();
29 // Delete the server channel after the RenderThread so that 29 // Delete the server channel after the RenderThread so that
30 // IPC::SyncChannel's OnChannelError doesn't fire on the context and attempt 30 // IPC::SyncChannel's OnChannelError doesn't fire on the context and attempt
(...skipping 16 matching lines...) Expand all
47 skia::PlatformCanvas* canvas = 47 skia::PlatformCanvas* canvas =
48 RenderProcess::current()->GetDrawingCanvas(&dib, rect); 48 RenderProcess::current()->GetDrawingCanvas(&dib, rect);
49 ASSERT_TRUE(dib); 49 ASSERT_TRUE(dib);
50 ASSERT_TRUE(canvas); 50 ASSERT_TRUE(canvas);
51 RenderProcess::current()->ReleaseTransportDIB(dib); 51 RenderProcess::current()->ReleaseTransportDIB(dib);
52 delete canvas; 52 delete canvas;
53 #endif 53 #endif
54 } 54 }
55 55
56 } // namespace 56 } // namespace
OLDNEW
« no previous file with comments | « chrome/renderer/render_process.cc ('k') | chrome/renderer/render_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698