Index: chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellTestBase.java |
diff --git a/chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellTestBase.java b/chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellTestBase.java |
index aabfc48151dcd5bc450b903427452a33a2b44701..1c80486c65f20684b46ed90e7538aba55c706b93 100644 |
--- a/chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellTestBase.java |
+++ b/chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellTestBase.java |
@@ -57,7 +57,7 @@ public class ChromiumTestShellTestBase extends |
* @return Whether or not the Shell was actually finished loading. |
* @throws Exception |
*/ |
- protected boolean waitForActiveShellToBeDoneLoading() throws Exception { |
+ protected boolean waitForActiveShellToBeDoneLoading() throws InterruptedException { |
final ChromiumTestShellActivity activity = getActivity(); |
// Wait for the Content Shell to be initialized. |
@@ -86,4 +86,18 @@ public class ChromiumTestShellTestBase extends |
} |
}, WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT, CriteriaHelper.DEFAULT_POLLING_INTERVAL); |
} |
+ |
+ /** |
+ * Navigates the currently active tab to a sanitized version of {@code url}. |
+ * @param url The potentially unsanitized URL to navigate to. |
+ */ |
+ public void loadUrlWithSanitization(final String url) throws InterruptedException { |
+ getInstrumentation().runOnMainSync(new Runnable() { |
+ @Override |
+ public void run() { |
+ getActivity().getActiveTab().loadUrlWithSanitization(url); |
+ } |
+ }); |
+ waitForActiveShellToBeDoneLoading(); |
+ } |
} |