OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_plugin/test_browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/test_browser_plugin_guest.h" |
6 | 6 |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 void TestBrowserPluginGuest::WaitForUpdateRectMsg() { | 92 void TestBrowserPluginGuest::WaitForUpdateRectMsg() { |
93 // Check if we already got any UpdateRect message. | 93 // Check if we already got any UpdateRect message. |
94 if (update_rect_count_ > 0) | 94 if (update_rect_count_ > 0) |
95 return; | 95 return; |
96 send_message_loop_runner_ = new MessageLoopRunner(); | 96 send_message_loop_runner_ = new MessageLoopRunner(); |
97 send_message_loop_runner_->Run(); | 97 send_message_loop_runner_->Run(); |
98 } | 98 } |
99 | 99 |
| 100 void TestBrowserPluginGuest::ResetUpdateRectCount() { |
| 101 update_rect_count_ = 0; |
| 102 } |
| 103 |
100 void TestBrowserPluginGuest::WaitForUpdateRectMsgWithSize(int width, | 104 void TestBrowserPluginGuest::WaitForUpdateRectMsgWithSize(int width, |
101 int height) { | 105 int height) { |
102 if (update_rect_count_ > 0 && | 106 if (update_rect_count_ > 0 && |
103 last_update_rect_width_ == width && | 107 last_update_rect_width_ == width && |
104 last_update_rect_height_ == height) { | 108 last_update_rect_height_ == height) { |
105 // We already saw this message. | 109 // We already saw this message. |
106 return; | 110 return; |
107 } | 111 } |
108 waiting_for_update_rect_msg_with_size_ = true; | 112 waiting_for_update_rect_msg_with_size_ = true; |
109 expected_width_ = width; | 113 expected_width_ = width; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 166 } |
163 | 167 |
164 bool TestBrowserPluginGuest::ViewTakeFocus(bool reverse) { | 168 bool TestBrowserPluginGuest::ViewTakeFocus(bool reverse) { |
165 advance_focus_observed_ = true; | 169 advance_focus_observed_ = true; |
166 if (advance_focus_message_loop_runner_) | 170 if (advance_focus_message_loop_runner_) |
167 advance_focus_message_loop_runner_->Quit(); | 171 advance_focus_message_loop_runner_->Quit(); |
168 return BrowserPluginGuest::ViewTakeFocus(reverse); | 172 return BrowserPluginGuest::ViewTakeFocus(reverse); |
169 } | 173 } |
170 | 174 |
171 } // namespace content | 175 } // namespace content |
OLD | NEW |