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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 302553007: Call RenderViewImpl::SetScreenOrientationForTesting to make sure that events are not sent when orie… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now ResetMockScreenOrientationForTesting() is called on every layout test finish, so replaced DCHEC… Created 6 years, 6 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/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index cd8628f4fa91834dc05212609001d2d5ab6ee4c5..f26c1f9f136984deac5738ffbffb7b8590271cdb 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/lazy_instance.h"
+#include "base/logging.h"
#include "base/memory/shared_memory.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/metrics/histogram.h"
@@ -1083,7 +1084,8 @@ void RendererWebKitPlatformSupportImpl::SetMockDeviceMotionDataForTesting(
// static
void RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationForTesting()
{
- g_test_screen_orientation_controller.Get().ResetData();
+ if (!(g_test_screen_orientation_controller == 0))
+ g_test_screen_orientation_controller.Get().ResetData();
}
//------------------------------------------------------------------------------
@@ -1177,9 +1179,10 @@ void RendererWebKitPlatformSupportImpl::unlockOrientation() {
// static
void RendererWebKitPlatformSupportImpl::SetMockScreenOrientationForTesting(
+ RenderView* render_view,
blink::WebScreenOrientationType orientation) {
g_test_screen_orientation_controller.Get()
- .UpdateDeviceOrientation(orientation);
+ .UpdateDeviceOrientation(render_view, orientation);
}
//------------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698