| OLD | NEW |
| 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 "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
| 10 #include "content/browser/renderer_host/backing_store.h" | 10 #include "content/browser/renderer_host/backing_store.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 RenderWidgetHostTest() : process_(NULL) { | 254 RenderWidgetHostTest() : process_(NULL) { |
| 255 } | 255 } |
| 256 ~RenderWidgetHostTest() { | 256 ~RenderWidgetHostTest() { |
| 257 } | 257 } |
| 258 | 258 |
| 259 protected: | 259 protected: |
| 260 // testing::Test | 260 // testing::Test |
| 261 void SetUp() { | 261 void SetUp() { |
| 262 browser_context_.reset(new TestBrowserContext()); | 262 browser_context_.reset(new TestBrowserContext()); |
| 263 process_ = new RenderWidgetHostProcess(browser_context_.get()); | 263 process_ = new RenderWidgetHostProcess(browser_context_.get()); |
| 264 host_.reset(new MockRenderWidgetHost(process_, 1)); | 264 host_.reset(new MockRenderWidgetHost(process_, MSG_ROUTING_NONE)); |
| 265 view_.reset(new TestView(host_.get())); | 265 view_.reset(new TestView(host_.get())); |
| 266 host_->SetView(view_.get()); | 266 host_->SetView(view_.get()); |
| 267 host_->Init(); | 267 host_->Init(); |
| 268 } | 268 } |
| 269 void TearDown() { | 269 void TearDown() { |
| 270 view_.reset(); | 270 view_.reset(); |
| 271 host_.reset(); | 271 host_.reset(); |
| 272 process_ = NULL; | 272 process_ = NULL; |
| 273 browser_context_.reset(); | 273 browser_context_.reset(); |
| 274 | 274 |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 // Start it again to ensure it still works. | 740 // Start it again to ensure it still works. |
| 741 EXPECT_FALSE(host_->unresponsive_timer_fired()); | 741 EXPECT_FALSE(host_->unresponsive_timer_fired()); |
| 742 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); | 742 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); |
| 743 | 743 |
| 744 // Wait long enough for first timeout and see if it fired. | 744 // Wait long enough for first timeout and see if it fired. |
| 745 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 745 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 746 MessageLoop::QuitClosure(), 40); | 746 MessageLoop::QuitClosure(), 40); |
| 747 MessageLoop::current()->Run(); | 747 MessageLoop::current()->Run(); |
| 748 EXPECT_TRUE(host_->unresponsive_timer_fired()); | 748 EXPECT_TRUE(host_->unresponsive_timer_fired()); |
| 749 } | 749 } |
| OLD | NEW |