Commit 8bcdeeeb authored by Becky Zhou's avatar Becky Zhou Committed by Commit Bot

Enable send tab to self for TabModalPresenterTest#testShow_UrlBarFocused

We removed logic listening to BottomSheetObserver from
https://chromium-review.googlesource.com/c/chromium/src/+/1553710,
but there are some obsolete logic causing the view hierarchy not
updated correctly.

Bug: 984793
Change-Id: Ibef11b60324bbf10abafafd6c73041f3fd20175d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709005
Commit-Queue: Becky Zhou <huayinz@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680438}
parent acc31fec
...@@ -43,7 +43,6 @@ public class TabModalLifetimeHandler implements NativeInitObserver, Destroyable ...@@ -43,7 +43,6 @@ public class TabModalLifetimeHandler implements NativeInitObserver, Destroyable
private final ModalDialogManager mManager; private final ModalDialogManager mManager;
private TabModalPresenter mPresenter; private TabModalPresenter mPresenter;
private TabModelSelectorTabModelObserver mTabModelObserver; private TabModelSelectorTabModelObserver mTabModelObserver;
private boolean mHasBottomControls;
private Tab mActiveTab; private Tab mActiveTab;
/** /**
...@@ -63,10 +62,7 @@ public class TabModalLifetimeHandler implements NativeInitObserver, Destroyable ...@@ -63,10 +62,7 @@ public class TabModalLifetimeHandler implements NativeInitObserver, Destroyable
public void onOmniboxFocusChanged(boolean hasFocus) { public void onOmniboxFocusChanged(boolean hasFocus) {
if (mPresenter == null) return; if (mPresenter == null) return;
// If has bottom controls, the view hierarchy will be updated by mBottomSheetObserver. if (mPresenter.getDialogModel() != null) mPresenter.updateContainerHierarchy(!hasFocus);
if (mPresenter.getDialogModel() != null && !mHasBottomControls) {
mPresenter.updateContainerHierarchy(!hasFocus);
}
} }
/** /**
...@@ -82,7 +78,6 @@ public class TabModalLifetimeHandler implements NativeInitObserver, Destroyable ...@@ -82,7 +78,6 @@ public class TabModalLifetimeHandler implements NativeInitObserver, Destroyable
public void onFinishNativeInitialization() { public void onFinishNativeInitialization() {
mPresenter = new TabModalPresenter(mActivity); mPresenter = new TabModalPresenter(mActivity);
mManager.registerPresenter(mPresenter, ModalDialogType.TAB); mManager.registerPresenter(mPresenter, ModalDialogType.TAB);
mHasBottomControls = mActivity.getBottomSheet() != null;
handleTabChanged(mActivity.getActivityTab()); handleTabChanged(mActivity.getActivityTab());
TabModelSelector tabModelSelector = mActivity.getTabModelSelector(); TabModelSelector tabModelSelector = mActivity.getTabModelSelector();
......
...@@ -42,7 +42,6 @@ import org.chromium.base.test.util.CommandLineFlags; ...@@ -42,7 +42,6 @@ import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.Restriction; import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.omnibox.UrlBar; import org.chromium.chrome.browser.omnibox.UrlBar;
...@@ -52,7 +51,6 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner; ...@@ -52,7 +51,6 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
import org.chromium.chrome.test.util.ChromeTabUtils; import org.chromium.chrome.test.util.ChromeTabUtils;
import org.chromium.chrome.test.util.OmniboxTestUtils; import org.chromium.chrome.test.util.OmniboxTestUtils;
import org.chromium.chrome.test.util.browser.Features.DisableFeatures;
import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modaldialog.DialogDismissalCause; import org.chromium.ui.modaldialog.DialogDismissalCause;
import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.ui.modaldialog.ModalDialogManager;
...@@ -113,11 +111,9 @@ public class TabModalPresenterTest { ...@@ -113,11 +111,9 @@ public class TabModalPresenterTest {
mTabModalPresenter.disableAnimationForTest(); mTabModalPresenter.disableAnimationForTest();
} }
// TODO(crbug/984793) remove explicit disabling for send_tab_to_self in this test.
@Test @Test
@SmallTest @SmallTest
@Feature({"ModalDialog"}) @Feature({"ModalDialog"})
@DisableFeatures(ChromeFeatureList.SEND_TAB_TO_SELF)
public void testShow_UrlBarFocused() throws Exception { public void testShow_UrlBarFocused() throws Exception {
// Show a tab modal dialog. The dialog should be shown on top of the toolbar. // Show a tab modal dialog. The dialog should be shown on top of the toolbar.
PropertyModel dialog1 = createDialog(mActivity, "1", null); PropertyModel dialog1 = createDialog(mActivity, "1", null);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment