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

Unified Diff: chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java

Issue 1305213003: Convert ChromeSyncShell to use ChromePublic infrastructure (try #2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java
diff --git a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java
index 9951b85f7c4adc9a89e0c2630bceffadc2c81f3d..e164db30f9ecf007b079843765295e9f4131946a 100644
--- a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java
+++ b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java
@@ -9,6 +9,7 @@ import android.util.Pair;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
+import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import org.chromium.chrome.test.util.browser.sync.SyncTestUtil;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
@@ -89,8 +90,8 @@ public class OpenTabsTest extends SyncTestBase {
@Feature({"Sync"})
public void testUploadMultipleOpenTabs() throws Exception {
loadUrl(URL);
- openNewTab(URL2);
- openNewTab(URL3);
+ loadUrlInNewTab(URL2);
+ loadUrlInNewTab(URL3);
waitForLocalTabsForClient(mClientName, URL, URL2, URL3);
waitForServerTabs(URL, URL2, URL3);
}
@@ -101,10 +102,17 @@ public class OpenTabsTest extends SyncTestBase {
public void testUploadAndCloseOpenTab() throws Exception {
loadUrl(URL);
// Can't have zero tabs, so we have to open two to test closing one.
- openNewTab(URL2);
+ loadUrlInNewTab(URL2);
waitForLocalTabsForClient(mClientName, URL, URL2);
waitForServerTabs(URL, URL2);
- closeActiveTab();
+
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ assertTrue(TabModelUtils.closeCurrentTab(getActivity().getCurrentTabModel()));
+ }
+ });
+
waitForLocalTabsForClient(mClientName, URL);
waitForServerTabs(URL);
}
@@ -169,24 +177,6 @@ public class OpenTabsTest extends SyncTestBase {
waitForLocalTabsForClient(FAKE_CLIENT);
}
- private void openNewTab(final String url) {
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- getActivity().createTab(url);
- }
- });
- }
-
- private void closeActiveTab() {
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- getActivity().closeTab();
- }
- });
- }
-
private String makeSessionTag() {
return SESSION_TAG_PREFIX + (mSessionTagCounter++);
}

Powered by Google App Engine
This is Rietveld 408576698