OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/frame_host/render_widget_host_view_guest.h" | 5 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 9 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
10 #include "content/browser/renderer_host/render_widget_host_impl.h" | 10 #include "content/browser/renderer_host/render_widget_host_impl.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 public: | 27 public: |
28 RenderWidgetHostViewGuestTest() {} | 28 RenderWidgetHostViewGuestTest() {} |
29 | 29 |
30 virtual void SetUp() { | 30 virtual void SetUp() { |
31 browser_context_.reset(new TestBrowserContext); | 31 browser_context_.reset(new TestBrowserContext); |
32 MockRenderProcessHost* process_host = | 32 MockRenderProcessHost* process_host = |
33 new MockRenderProcessHost(browser_context_.get()); | 33 new MockRenderProcessHost(browser_context_.get()); |
34 widget_host_ = new RenderWidgetHostImpl( | 34 widget_host_ = new RenderWidgetHostImpl( |
35 &delegate_, process_host, MSG_ROUTING_NONE, false); | 35 &delegate_, process_host, MSG_ROUTING_NONE, false); |
36 view_ = new RenderWidgetHostViewGuest( | 36 view_ = new RenderWidgetHostViewGuest( |
37 widget_host_, NULL, new TestRenderWidgetHostView(widget_host_)); | 37 widget_host_, NULL, |
| 38 (new TestRenderWidgetHostView(widget_host_))->GetWeakPtr()); |
38 } | 39 } |
39 | 40 |
40 virtual void TearDown() { | 41 virtual void TearDown() { |
41 if (view_) | 42 if (view_) |
42 view_->Destroy(); | 43 view_->Destroy(); |
43 delete widget_host_; | 44 delete widget_host_; |
44 | 45 |
45 browser_context_.reset(); | 46 browser_context_.reset(); |
46 | 47 |
47 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 48 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); |
(...skipping 24 matching lines...) Expand all Loading... |
72 ASSERT_FALSE(view_->IsShowing()); | 73 ASSERT_FALSE(view_->IsShowing()); |
73 | 74 |
74 view_->WasShown(); | 75 view_->WasShown(); |
75 ASSERT_TRUE(view_->IsShowing()); | 76 ASSERT_TRUE(view_->IsShowing()); |
76 | 77 |
77 view_->WasHidden(); | 78 view_->WasHidden(); |
78 ASSERT_FALSE(view_->IsShowing()); | 79 ASSERT_FALSE(view_->IsShowing()); |
79 } | 80 } |
80 | 81 |
81 } // namespace content | 82 } // namespace content |
OLD | NEW |