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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java

Issue 1924473002: Don't hide the reparenting tab while detaching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 8 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 | « chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
index b74be988fcd0bba5be0d64ad69c267d23b2446d4..c2a9ae526424e91875b4e1a868940ea69fdecfb0 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -55,6 +55,7 @@ import org.chromium.chrome.browser.prerender.ExternalPrerenderHandler;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
+import org.chromium.chrome.browser.tab.TabObserver;
import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver;
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
@@ -1229,6 +1230,14 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
final ActivityMonitor monitor = getInstrumentation().addMonitor(
ChromeTabbedActivity.class.getName(), result, false);
final Tab tabToBeReparented = mActivity.getActivityTab();
+ final CallbackHelper tabHiddenHelper = new CallbackHelper();
+ TabObserver observer = new EmptyTabObserver() {
+ @Override
+ public void onHidden(Tab tab) {
+ tabHiddenHelper.notifyCalled();
+ }
+ };
+ tabToBeReparented.addObserver(observer);
ThreadUtils.postOnUiThread(new Runnable() {
@Override
public void run() {
@@ -1261,6 +1270,9 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
assertEquals(newActivity.getWindowAndroid(),
tabToBeReparented.getContentViewCore().getWindowAndroid());
assertFalse(tabToBeReparented.getDelegateFactory() instanceof CustomTabDelegateFactory);
+ assertEquals("The tab should never be hidden during the reparenting process",
+ 0, tabHiddenHelper.getCallCount());
+ tabToBeReparented.removeObserver(observer);
return newActivity;
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698