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

Unified Diff: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/MockOrientationObserver.java

Issue 196193002: Implement ScreenOrientationProvider for Chrome Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 6 years, 9 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/public/test/android/javatests/src/org/chromium/content/browser/test/util/MockOrientationObserver.java
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/MockOrientationObserver.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/MockOrientationObserver.java
new file mode 100644
index 0000000000000000000000000000000000000000..eaaa3e65f82391214fb47286a6c34daae7c9589a
--- /dev/null
+++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/MockOrientationObserver.java
@@ -0,0 +1,22 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser.test.util;
+
+import org.chromium.content.browser.ScreenOrientationListener.ScreenOrientationObserver;
+
+/**
+ * Mock of an OrientationObserver for tests that need to observe ScreenOrientation changes.
+ */
+public class MockOrientationObserver implements ScreenOrientationObserver {
+
+ public int mOrientation = -1;
+ public boolean mHasChanged = false;
+
+ @Override
+ public void onScreenOrientationChanged(int orientation) {
+ mOrientation = orientation;
+ mHasChanged = true;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698