| 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/browser_plugin/test_timeout_tracker.h" | 9 #include "content/browser/browser_plugin/test_timeout_tracker.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 bool TestBrowserPluginGuest::WaitForUpdateRectMsg() { | 69 bool TestBrowserPluginGuest::WaitForUpdateRectMsg() { |
| 70 // Check if we already got any UpdateRect message. | 70 // Check if we already got any UpdateRect message. |
| 71 if (update_rect_count_ > 0) | 71 if (update_rect_count_ > 0) |
| 72 return true; | 72 return true; |
| 73 | 73 |
| 74 send_message_loop_runner_ = new MessageLoopRunner(); | 74 send_message_loop_runner_ = new MessageLoopRunner(); |
| 75 return TestTimeoutTracker::RunInActionTimeout( | 75 return TestTimeoutTracker::RunInActionTimeout( |
| 76 send_message_loop_runner_.get()); | 76 send_message_loop_runner_.get()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void TestBrowserPluginGuest::ResetUpdateRectCount() { |
| 80 update_rect_count_ = 0; |
| 81 } |
| 82 |
| 79 bool TestBrowserPluginGuest::WaitForUpdateRectMsgWithSize(int width, | 83 bool TestBrowserPluginGuest::WaitForUpdateRectMsgWithSize(int width, |
| 80 int height) { | 84 int height) { |
| 81 if (update_rect_count_ > 0 && | 85 if (update_rect_count_ > 0 && |
| 82 last_update_rect_width_ == width && | 86 last_update_rect_width_ == width && |
| 83 last_update_rect_height_ == height) { | 87 last_update_rect_height_ == height) { |
| 84 // We already saw this message. | 88 // We already saw this message. |
| 85 return true; | 89 return true; |
| 86 } | 90 } |
| 87 waiting_for_update_rect_msg_with_size_ = true; | 91 waiting_for_update_rect_msg_with_size_ = true; |
| 88 expected_width_ = width; | 92 expected_width_ = width; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 139 } |
| 136 | 140 |
| 137 bool TestBrowserPluginGuest::ViewTakeFocus(bool reverse) { | 141 bool TestBrowserPluginGuest::ViewTakeFocus(bool reverse) { |
| 138 advance_focus_observed_ = true; | 142 advance_focus_observed_ = true; |
| 139 if (advance_focus_message_loop_runner_) | 143 if (advance_focus_message_loop_runner_) |
| 140 advance_focus_message_loop_runner_->Quit(); | 144 advance_focus_message_loop_runner_->Quit(); |
| 141 return BrowserPluginGuest::ViewTakeFocus(reverse); | 145 return BrowserPluginGuest::ViewTakeFocus(reverse); |
| 142 } | 146 } |
| 143 | 147 |
| 144 } // namespace content | 148 } // namespace content |
| OLD | NEW |