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

Unified Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 9980016: Delete background tab IOSurfaces on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed auto-resize and fullscreen toggle Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 8f5c465a87afac5d1ce457c4bf42671f85df3d1e..eb48d85279a493db4dfcf3f0e835e5598bc61b36 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -66,14 +66,14 @@ class RenderWidgetHostProcess : public MockRenderProcessHost {
virtual bool HasConnection() const { return true; }
protected:
- virtual bool WaitForUpdateMsg(int render_widget_id,
- const base::TimeDelta& max_delay,
- IPC::Message* msg);
+ virtual bool WaitForBackingStoreMsg(int render_widget_id,
+ const base::TimeDelta& max_delay,
+ IPC::Message* msg);
TransportDIB* current_update_buf_;
- // Set to true when WaitForUpdateMsg should return a successful update message
- // reply. False implies timeout.
+ // Set to true when WaitForBackingStoreMsg should return a successful update
+ // message reply. False implies timeout.
bool update_msg_should_reply_;
// Indicates the flags that should be sent with a the repaint request. This
@@ -101,9 +101,10 @@ void RenderWidgetHostProcess::InitUpdateRectParams(
params->needs_ack = true;
}
-bool RenderWidgetHostProcess::WaitForUpdateMsg(int render_widget_id,
- const base::TimeDelta& max_delay,
- IPC::Message* msg) {
+bool RenderWidgetHostProcess::WaitForBackingStoreMsg(
+ int render_widget_id,
+ const base::TimeDelta& max_delay,
+ IPC::Message* msg) {
if (!update_msg_should_reply_)
return false;
@@ -508,6 +509,11 @@ TEST_F(RenderWidgetHostTest, Background) {
// Tests getting the backing store with the renderer not setting repaint ack
// flags.
TEST_F(RenderWidgetHostTest, GetBackingStore_NoRepaintAck) {
+ // First set the view size to match what the renderer is rendering.
+ ViewHostMsg_UpdateRect_Params params;
+ process_->InitUpdateRectParams(&params);
+ view_->set_bounds(gfx::Rect(params.view_size));
+
// We don't currently have a backing store, and if the renderer doesn't send
// one in time, we should get nothing.
process_->set_update_msg_should_reply(false);
@@ -534,6 +540,11 @@ TEST_F(RenderWidgetHostTest, GetBackingStore_NoRepaintAck) {
// Tests getting the backing store with the renderer sending a repaint ack.
TEST_F(RenderWidgetHostTest, GetBackingStore_RepaintAck) {
+ // First set the view size to match what the renderer is rendering.
+ ViewHostMsg_UpdateRect_Params params;
+ process_->InitUpdateRectParams(&params);
+ view_->set_bounds(gfx::Rect(params.view_size));
+
// Doing a request request with the update message allowed should work and
// the repaint ack should work.
process_->set_update_msg_should_reply(true);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698