Commit f6a24e50 authored by Gayane Petrosyan's avatar Gayane Petrosyan Committed by Commit Bot

File-to-Uri should be called in a background thread.

Bug: 1056176
Change-Id: I3e3b4cdca19c628c1e575fae2e90fe0f016e488b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078982
Commit-Queue: Gayane Petrosyan <gayane@chromium.org>
Auto-Submit: Gayane Petrosyan <gayane@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748805}
parent debdcfb3
...@@ -148,7 +148,6 @@ public class ContextMenuTest implements CustomMainActivityStart { ...@@ -148,7 +148,6 @@ public class ContextMenuTest implements CustomMainActivityStart {
@Test @Test
@MediumTest @MediumTest
@DisabledTest(message = "https://crbug.com/1056176")
@Feature({"Browser"}) @Feature({"Browser"})
@EnableFeatures({ChromeFeatureList.CONTEXT_MENU_SEARCH_WITH_GOOGLE_LENS}) @EnableFeatures({ChromeFeatureList.CONTEXT_MENU_SEARCH_WITH_GOOGLE_LENS})
public void testSearchWithGoogleLensFiresIntent() throws Throwable { public void testSearchWithGoogleLensFiresIntent() throws Throwable {
...@@ -166,7 +165,6 @@ public class ContextMenuTest implements CustomMainActivityStart { ...@@ -166,7 +165,6 @@ public class ContextMenuTest implements CustomMainActivityStart {
@Test @Test
@MediumTest @MediumTest
@DisabledTest(message = "https://crbug.com/1056176")
@Feature({"Browser"}) @Feature({"Browser"})
@CommandLineFlags.Add({"enable-features=" @CommandLineFlags.Add({"enable-features="
+ ChromeFeatureList.CONTEXT_MENU_SEARCH_WITH_GOOGLE_LENS + "<FakeStudyName", + ChromeFeatureList.CONTEXT_MENU_SEARCH_WITH_GOOGLE_LENS + "<FakeStudyName",
......
...@@ -123,7 +123,17 @@ public class ShareImageFileUtils { ...@@ -123,7 +123,17 @@ public class ShareImageFileUtils {
OnImageSaveListener listener = new OnImageSaveListener() { OnImageSaveListener listener = new OnImageSaveListener() {
@Override @Override
public void onImageSaved(File imageFile) { public void onImageSaved(File imageFile) {
callback.onResult(ContentUriUtils.getContentUriFromFile(imageFile)); new AsyncTask<Uri>() {
@Override
protected Uri doInBackground() {
return ContentUriUtils.getContentUriFromFile(imageFile);
}
@Override
protected void onPostExecute(Uri uri) {
callback.onResult(uri);
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} }
@Override @Override
public void onImageSaveError() {} public void onImageSaveError() {}
......
...@@ -29,7 +29,6 @@ import org.chromium.base.task.AsyncTask; ...@@ -29,7 +29,6 @@ import org.chromium.base.task.AsyncTask;
import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisableIf; import org.chromium.base.test.util.DisableIf;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeActivityTestRule;
...@@ -176,7 +175,6 @@ public class ShareImageFileUtilsTest { ...@@ -176,7 +175,6 @@ public class ShareImageFileUtilsTest {
@Test @Test
@SmallTest @SmallTest
@DisabledTest(message = "https://crbug.com/1056176")
public void clipboardUriDoNotClearTest() throws TimeoutException, IOException { public void clipboardUriDoNotClearTest() throws TimeoutException, IOException {
generateAnImageToClipboard(); generateAnImageToClipboard();
generateAnImageToClipboard(); generateAnImageToClipboard();
...@@ -190,7 +188,6 @@ public class ShareImageFileUtilsTest { ...@@ -190,7 +188,6 @@ public class ShareImageFileUtilsTest {
@Test @Test
@SmallTest @SmallTest
@DisabledTest(message = "https://crbug.com/1056176")
public void clearEverythingIfNoClipboardImageTest() throws TimeoutException, IOException { public void clearEverythingIfNoClipboardImageTest() throws TimeoutException, IOException {
generateAnImageToClipboard(); generateAnImageToClipboard();
generateAnImageToClipboard(); generateAnImageToClipboard();
......
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