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

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

Issue 12717011: [Android] Remove unused function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « build/android/findbugs_filter/findbugs_known_bugs.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/UiUtils.java
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/UiUtils.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/UiUtils.java
index 0dea234e2dc6cc5344d6cabfa7739e9f25b3dfa2..7c51542e84eb1223b5d183f65e98d4801c3a4480 100644
--- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/UiUtils.java
+++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/UiUtils.java
@@ -6,14 +6,12 @@ package org.chromium.content.browser.test.util;
import android.app.Activity;
import android.app.Instrumentation;
-import android.view.View;
-import java.lang.reflect.Field;
+import junit.framework.Assert;
+
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
-import junit.framework.Assert;
-
/**
* Collection of UI utilities.
*/
@@ -53,41 +51,4 @@ public class UiUtils {
instrumentation.waitForIdleSync();
Thread.sleep(1000);
}
-
- /**
- * Find the parent View for the Id across all activities, as dialogs
- * will be displayed in a separate activity. Note that in the case
- * of several views sharing the same ID across activities, this will
- * return the first view found.
- *
- * @param viewId The Id of the view.
- * @return the view which contains the given id or null if no view with the given id exists.
- */
- public static View findParentViewForIdAcrossActivities(int viewId) {
- View[] availableViews = null;
- try {
- Class<?> windowManager = Class.forName("android.view.WindowManagerImpl");
-
- Field viewsField = windowManager.getDeclaredField("mViews");
- Field instanceField = windowManager.getDeclaredField("sWindowManager");
- viewsField.setAccessible(true);
- instanceField.setAccessible(true);
- Object instance = instanceField.get(null);
- availableViews = (View[]) viewsField.get(instance);
- } catch(Exception e) {
- Assert.fail("Could not fetch the available views.");
- }
-
- if (availableViews == null || availableViews.length == 0) {
- return null;
- }
-
- for (View view : availableViews) {
- if (view.findViewById(viewId) != null) {
- return view;
- }
- }
-
- return null;
- }
}
« no previous file with comments | « build/android/findbugs_filter/findbugs_known_bugs.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698