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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 1129883003: Pass Surface ID namespace to renderer compositors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improved the way the surface id is passed to renderer Created 5 years, 7 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 unified diff | Download patch
OLDNEW
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/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 3351 matching lines...) Expand 10 before | Expand all | Expand 10 after
3362 SendInputEventACK(WebInputEvent::MouseWheel, 3362 SendInputEventACK(WebInputEvent::MouseWheel,
3363 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 3363 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
3364 EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode()); 3364 EXPECT_EQ(OVERSCROLL_NONE, overscroll_mode());
3365 EXPECT_EQ(15.f, overscroll_delta_x()); 3365 EXPECT_EQ(15.f, overscroll_delta_x());
3366 EXPECT_EQ(-5.f, overscroll_delta_y()); 3366 EXPECT_EQ(-5.f, overscroll_delta_y());
3367 SimulateGestureFlingStartEvent(0.f, 0.1f, blink::WebGestureDeviceTouchpad); 3367 SimulateGestureFlingStartEvent(0.f, 0.1f, blink::WebGestureDeviceTouchpad);
3368 EXPECT_EQ(0.f, overscroll_delta_x()); 3368 EXPECT_EQ(0.f, overscroll_delta_x());
3369 EXPECT_EQ(0.f, overscroll_delta_y()); 3369 EXPECT_EQ(0.f, overscroll_delta_y());
3370 } 3370 }
3371 3371
3372 // Tests the RenderWidgetHostImpl sends the correct surface ID namespace to
3373 // the renderer process.
3374 TEST_F(RenderWidgetHostViewAuraTest, SurfaceIdNamespaceInitialized) {
3375 gfx::Size size(5, 5);
3376
3377 const IPC::Message* msg =
3378 sink_->GetUniqueMessageMatching(ViewMsg_SetSurfaceIdNamespace::ID);
3379 EXPECT_TRUE(msg);
3380 ViewMsg_SetSurfaceIdNamespace::Param params;
3381 ViewMsg_SetSurfaceIdNamespace::Read(msg, &params);
3382 view_->InitAsChild(NULL);
3383 view_->Show();
3384 view_->SetSize(size);
3385 view_->OnSwapCompositorFrame(0,
3386 MakeDelegatedFrame(1.f, size, gfx::Rect(size)));
3387 EXPECT_EQ(view_->GetSurfaceIdNamespace(), get<0>(params));
3388 }
3389
3372 } // namespace content 3390 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698