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

Unified Diff: chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java

Issue 850813002: Upstream Site Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@location_settings_singleton
Patch Set: use findbugs annotations; fix test Created 5 years, 11 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: chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java
diff --git a/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java b/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java
index c11e001e9164b567578cbc2e2d56253236b40ebf..cff6c76ee8fc2dc81b85a9781bd59a604a0120f2 100644
--- a/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java
+++ b/chrome/android/shell/javatests/src/org/chromium/chrome/shell/ChromeShellTestBase.java
@@ -21,6 +21,7 @@ import org.chromium.chrome.test.util.ApplicationData;
import org.chromium.content.browser.BrowserStartupController;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
+import org.chromium.content_public.browser.LoadUrlParams;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -123,6 +124,19 @@ public class ChromeShellTestBase extends ActivityInstrumentationTestCase2<Chrome
}
/**
+ * Navigates the currently active tab to {@code url} and waits for the page to finish loading.
+ */
+ public void loadUrl(final String url) throws InterruptedException {
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ getActivity().getActiveTab().loadUrl(new LoadUrlParams(url));
+ }
+ });
+ waitForActiveShellToBeDoneLoading();
+ }
+
+ /**
* Navigates the currently active tab to a sanitized version of {@code url}.
* @param url The potentially unsanitized URL to navigate to.
*/
@@ -147,8 +161,8 @@ public class ChromeShellTestBase extends ActivityInstrumentationTestCase2<Chrome
assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {
@Override
public boolean isSatisfied() {
- return getActivity().getActiveTab().getContentViewCore().getScale() ==
- expectedScale;
+ return getActivity().getActiveTab().getContentViewCore().getScale()
+ == expectedScale;
}
}));
}

Powered by Google App Engine
This is Rietveld 408576698