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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/media/router/MediaRouterIntegrationTest.java

Issue 1844793004: [MediaRouter, Android] Don't ignore device selection dialog failures in MediaRouter integration tes… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo remove comments Created 4 years, 9 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/javatests/src/org/chromium/chrome/browser/media/RouterTestUtils.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/media/router/MediaRouterIntegrationTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/media/router/MediaRouterIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/media/router/MediaRouterIntegrationTest.java
index 8b33fd0d548e74b8a1d28ebceb40c83f158119f4..c11ed69ad05a5e8b75680dfcd9c32bfa6688a7a9 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/media/router/MediaRouterIntegrationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/media/router/MediaRouterIntegrationTest.java
@@ -12,7 +12,6 @@ import android.os.StrictMode;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View;
-import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
@@ -41,8 +40,6 @@ import java.util.concurrent.TimeoutException;
@CommandLineFlags.Add(ContentSwitches.DISABLE_GESTURE_REQUIREMENT_FOR_PRESENTATION)
public class MediaRouterIntegrationTest extends ChromeActivityTestCaseBase<ChromeActivity> {
- private static final String TAG = "MediaRouterTest";
-
private static final String TEST_PAGE =
"/chrome/test/media_router/resources/basic_test.html?__is_android__=true";
private static final String TEST_PAGE_RECONNECT_FAIL =
@@ -215,16 +212,9 @@ public class MediaRouterIntegrationTest extends ChromeActivityTestCaseBase<Chrom
WebContents webContents = getActivity().getActivityTab().getWebContents();
executeJavaScriptApi(webContents, WAIT_DEVICE_SCRIPT);
executeJavaScriptApi(webContents, START_SESSION_SCRIPT);
- try {
- View testRouteButton = RouterTestUtils.waitForRouteButton(
- getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
- RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
- } catch (AssertionError e) {
- // TODO(zqzhang): the device might not be shown in the dialog on some bots. Please check
- // the logcat to see if it really passed.
- Log.w(TAG, "Device not shown in the dialog. The test might be false negative.");
- return;
- }
+ View testRouteButton = RouterTestUtils.waitForRouteButton(
+ getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
+ RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
executeJavaScriptApi(webContents, CHECK_SESSION_SCRIPT);
String sessionId = getJavaScriptVariable(webContents, "startedConnection.id");
assertFalse(sessionId.length() == 0);
@@ -244,16 +234,9 @@ public class MediaRouterIntegrationTest extends ChromeActivityTestCaseBase<Chrom
WebContents webContents = getActivity().getActivityTab().getWebContents();
executeJavaScriptApi(webContents, WAIT_DEVICE_SCRIPT);
executeJavaScriptApi(webContents, START_SESSION_SCRIPT);
- try {
- View testRouteButton = RouterTestUtils.waitForRouteButton(
- getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
- RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
- } catch (AssertionError e) {
- // TODO(zqzhang): the device might not be shown in the dialog on some bots. Please check
- // the logcat to see if it really passed.
- Log.w(TAG, "Device not shown in the dialog. The test might be false negative.");
- return;
- }
+ View testRouteButton = RouterTestUtils.waitForRouteButton(
+ getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
+ RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
executeJavaScriptApi(webContents, CHECK_SESSION_SCRIPT);
String sessionId = getJavaScriptVariable(webContents, "startedConnection.id");
assertFalse(sessionId.length() == 0);
@@ -269,16 +252,9 @@ public class MediaRouterIntegrationTest extends ChromeActivityTestCaseBase<Chrom
WebContents webContents = getActivity().getActivityTab().getWebContents();
executeJavaScriptApi(webContents, WAIT_DEVICE_SCRIPT);
executeJavaScriptApi(webContents, START_SESSION_SCRIPT);
- try {
- View testRouteButton = RouterTestUtils.waitForRouteButton(
- getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
- RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
- } catch (AssertionError e) {
- // TODO(zqzhang): the device might not be shown in the dialog on some bots. Please check
- // the logcat to see if it really passed.
- Log.w(TAG, "Device not shown in the dialog. The test might be false negative.");
- return;
- }
+ View testRouteButton = RouterTestUtils.waitForRouteButton(
+ getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
+ RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
executeJavaScriptApi(webContents, CHECK_SESSION_SCRIPT);
String sessionId = getJavaScriptVariable(webContents, "startedConnection.id");
assertFalse(sessionId.length() == 0);
@@ -297,16 +273,9 @@ public class MediaRouterIntegrationTest extends ChromeActivityTestCaseBase<Chrom
WebContents webContents = getActivity().getActivityTab().getWebContents();
executeJavaScriptApi(webContents, WAIT_DEVICE_SCRIPT);
executeJavaScriptApi(webContents, START_SESSION_SCRIPT);
- try {
- View testRouteButton = RouterTestUtils.waitForRouteButton(
- getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
- RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
- } catch (AssertionError e) {
- // TODO(zqzhang): the device might not be shown in the dialog on some bots. Please check
- // the logcat to see if it really passed.
- Log.w(TAG, "Device not shown in the dialog. The test might be false negative.");
- return;
- }
+ View testRouteButton = RouterTestUtils.waitForRouteButton(
+ getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
+ RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
checkStartFailed(
webContents, "UnknownError", "No provider supports createRoute with source");
}
@@ -320,16 +289,9 @@ public class MediaRouterIntegrationTest extends ChromeActivityTestCaseBase<Chrom
WebContents webContents = getActivity().getActivityTab().getWebContents();
executeJavaScriptApi(webContents, WAIT_DEVICE_SCRIPT);
executeJavaScriptApi(webContents, START_SESSION_SCRIPT);
- try {
- View testRouteButton = RouterTestUtils.waitForRouteButton(
- getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
- RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
- } catch (AssertionError e) {
- // TODO(zqzhang): the device might not be shown in the dialog on some bots. Please check
- // the logcat to see if it really passed.
- Log.w(TAG, "Device not shown in the dialog. The test might be false negative.");
- return;
- }
+ View testRouteButton = RouterTestUtils.waitForRouteButton(
+ getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
+ RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
checkStartFailed(
webContents, "UnknownError", "Unknown sink");
}
@@ -342,16 +304,9 @@ public class MediaRouterIntegrationTest extends ChromeActivityTestCaseBase<Chrom
WebContents webContents = getActivity().getActivityTab().getWebContents();
executeJavaScriptApi(webContents, WAIT_DEVICE_SCRIPT);
executeJavaScriptApi(webContents, START_SESSION_SCRIPT);
- try {
- View testRouteButton = RouterTestUtils.waitForRouteButton(
- getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
- RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
- } catch (AssertionError e) {
- // TODO(zqzhang): the device might not be shown in the dialog on some bots. Please check
- // the logcat to see if it really passed.
- Log.w(TAG, "Device not shown in the dialog. The test might be false negative.");
- return;
- }
+ View testRouteButton = RouterTestUtils.waitForRouteButton(
+ getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
+ RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
executeJavaScriptApi(webContents, CHECK_SESSION_SCRIPT);
String sessionId = getJavaScriptVariable(webContents, "startedConnection.id");
@@ -375,16 +330,9 @@ public class MediaRouterIntegrationTest extends ChromeActivityTestCaseBase<Chrom
WebContents webContents = getActivity().getActivityTab().getWebContents();
executeJavaScriptApi(webContents, WAIT_DEVICE_SCRIPT);
executeJavaScriptApi(webContents, START_SESSION_SCRIPT);
- try {
- View testRouteButton = RouterTestUtils.waitForRouteButton(
- getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
- RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
- } catch (AssertionError e) {
- // TODO(zqzhang): the device might not be shown in the dialog on some bots. Please check
- // the logcat to see if it really passed.
- Log.w(TAG, "Device not shown in the dialog. The test might be false negative.");
- return;
- }
+ View testRouteButton = RouterTestUtils.waitForRouteButton(
+ getActivity(), TEST_SINK_NAME, VIEW_TIMEOUT_MS, VIEW_RETRY_MS);
+ RouterTestUtils.mouseSingleClickView(getInstrumentation(), testRouteButton);
executeJavaScriptApi(webContents, CHECK_SESSION_SCRIPT);
String sessionId = getJavaScriptVariable(webContents, "startedConnection.id");
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/media/RouterTestUtils.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698