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

Side by Side Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 7465041: GTTF: Use a fresh TestingBrowserProcess for each test, part #4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: should work Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/shared_memory.h" 7 #include "base/shared_memory.h"
8 #include "base/timer.h" 8 #include "base/timer.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/test/testing_profile.h" 10 #include "chrome/test/testing_profile.h"
11 #include "content/browser/browser_thread.h" 11 #include "content/browser/browser_thread.h"
12 #include "content/browser/renderer_host/backing_store.h" 12 #include "content/browser/renderer_host/backing_store.h"
13 #include "content/browser/renderer_host/test_render_view_host.h" 13 #include "content/browser/renderer_host/test_render_view_host.h"
14 #include "content/common/notification_details.h" 14 #include "content/common/notification_details.h"
15 #include "content/common/notification_observer.h" 15 #include "content/common/notification_observer.h"
16 #include "content/common/notification_registrar.h" 16 #include "content/common/notification_registrar.h"
17 #include "content/common/notification_source.h" 17 #include "content/common/notification_source.h"
18 #include "content/common/view_messages.h" 18 #include "content/common/view_messages.h"
19 #include "chrome/test/testing_browser_process_test.h"
19 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
20 #include "ui/base/keycodes/keyboard_codes.h" 21 #include "ui/base/keycodes/keyboard_codes.h"
21 #include "ui/gfx/canvas_skia.h" 22 #include "ui/gfx/canvas_skia.h"
22 23
23 using base::TimeDelta; 24 using base::TimeDelta;
24 25
25 using WebKit::WebInputEvent; 26 using WebKit::WebInputEvent;
26 using WebKit::WebMouseWheelEvent; 27 using WebKit::WebMouseWheelEvent;
27 28
28 namespace gfx { 29 namespace gfx {
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 240
240 private: 241 private:
241 MockRenderWidgetHost* host_; 242 MockRenderWidgetHost* host_;
242 int tag_; 243 int tag_;
243 gfx::Size size_; 244 gfx::Size size_;
244 }; 245 };
245 246
246 247
247 // RenderWidgetHostTest -------------------------------------------------------- 248 // RenderWidgetHostTest --------------------------------------------------------
248 249
249 class RenderWidgetHostTest : public testing::Test { 250 class RenderWidgetHostTest : public TestingBrowserProcessTest {
250 public: 251 public:
251 RenderWidgetHostTest() : process_(NULL) { 252 RenderWidgetHostTest() : process_(NULL) {
252 } 253 }
253 ~RenderWidgetHostTest() { 254 ~RenderWidgetHostTest() {
254 } 255 }
255 256
256 protected: 257 protected:
257 // testing::Test 258 // testing::Test
258 void SetUp() { 259 void SetUp() {
259 profile_.reset(new TestingProfile()); 260 profile_.reset(new TestingProfile());
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 // Start it again to ensure it still works. 729 // Start it again to ensure it still works.
729 EXPECT_FALSE(host_->unresponsive_timer_fired()); 730 EXPECT_FALSE(host_->unresponsive_timer_fired());
730 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); 731 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10));
731 732
732 // Wait long enough for first timeout and see if it fired. 733 // Wait long enough for first timeout and see if it fired.
733 MessageLoop::current()->PostDelayedTask(FROM_HERE, 734 MessageLoop::current()->PostDelayedTask(FROM_HERE,
734 new MessageLoop::QuitTask(), 10); 735 new MessageLoop::QuitTask(), 10);
735 MessageLoop::current()->Run(); 736 MessageLoop::current()->Run();
736 EXPECT_TRUE(host_->unresponsive_timer_fired()); 737 EXPECT_TRUE(host_->unresponsive_timer_fired());
737 } 738 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698