Commit 74c10cd3 authored by Lucas Furukawa Gadani's avatar Lucas Furukawa Gadani Committed by Commit Bot

Portals: Re-enable PortalBrowserTest.ActivatePortalInShell on Android.

This CL fixes the test flakyness and enables the test on Android.

Bug: 892004
Change-Id: Ibc08897c300ce9704cebf861249b8c7f719cf474
Reviewed-on: https://chromium-review.googlesource.com/c/1313735
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Reviewed-by: default avatarAJITH KUMAR V <ajith.v@samsung.com>
Reviewed-by: default avatarPedro Amaral <amaralp@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605012}
parent dae5b388
...@@ -49,6 +49,15 @@ SelectionPopupController::SelectionPopupController( ...@@ -49,6 +49,15 @@ SelectionPopupController::SelectionPopupController(
wcva->set_selection_popup_controller(this); wcva->set_selection_popup_controller(this);
} }
SelectionPopupController::~SelectionPopupController() {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_obj_.get(env);
if (!obj.is_null()) {
Java_SelectionPopupControllerImpl_nativeSelectionPopupControllerDestroyed(
env, obj);
}
}
ScopedJavaLocalRef<jobject> SelectionPopupController::GetContext() const { ScopedJavaLocalRef<jobject> SelectionPopupController::GetContext() const {
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
......
...@@ -54,7 +54,7 @@ class SelectionPopupController : public RenderWidgetHostConnector { ...@@ -54,7 +54,7 @@ class SelectionPopupController : public RenderWidgetHostConnector {
const gfx::PointF& extent); const gfx::PointF& extent);
private: private:
~SelectionPopupController() override {} ~SelectionPopupController() override;
base::android::ScopedJavaLocalRef<jobject> GetContext() const; base::android::ScopedJavaLocalRef<jobject> GetContext() const;
RenderWidgetHostViewAndroid* rwhva_ = nullptr; RenderWidgetHostViewAndroid* rwhva_ = nullptr;
......
...@@ -344,13 +344,7 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, MAYBE_ActivatePortal) { ...@@ -344,13 +344,7 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, MAYBE_ActivatePortal) {
} }
// Tests that a portal can be activated in content_shell. // Tests that a portal can be activated in content_shell.
// Disabled due to flakiness on Android. See https://crbug.com/892669. IN_PROC_BROWSER_TEST_F(PortalBrowserTest, ActivatePortalInShell) {
#if defined(OS_ANDROID)
#define MAYBE_ActivatePortalInShell DISABLED_ActivatePortalInShell
#else
#define MAYBE_ActivatePortalInShell ActivatePortalInShell
#endif
IN_PROC_BROWSER_TEST_F(PortalBrowserTest, MAYBE_ActivatePortalInShell) {
EXPECT_TRUE(NavigateToURL( EXPECT_TRUE(NavigateToURL(
shell(), embedded_test_server()->GetURL("portal.test", "/title1.html"))); shell(), embedded_test_server()->GetURL("portal.test", "/title1.html")));
WebContentsImpl* web_contents_impl = WebContentsImpl* web_contents_impl =
......
...@@ -1551,6 +1551,11 @@ public class SelectionPopupControllerImpl extends ActionModeCallbackHelper ...@@ -1551,6 +1551,11 @@ public class SelectionPopupControllerImpl extends ActionModeCallbackHelper
return client == null ? null : client.getCustomTextClassifier(); return client == null ? null : client.getCustomTextClassifier();
} }
@CalledByNative
private void nativeSelectionPopupControllerDestroyed() {
mNativeSelectionPopupController = 0;
}
private native long nativeInit(WebContents webContents); private native long nativeInit(WebContents webContents);
private native void nativeSetTextHandlesTemporarilyHidden( private native void nativeSetTextHandlesTemporarilyHidden(
long nativeSelectionPopupController, boolean hidden); long nativeSelectionPopupController, boolean hidden);
......
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