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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/tab/SadTabTest.java

Issue 2551273002: Fixed flaky SadTabReloadButton test (Closed)
Patch Set: Updated off twellington and tedchoc's comments Created 4 years 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 | « no previous file | 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/tab/SadTabTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/SadTabTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/SadTabTest.java
index eefb2a65c804956e1c83c4a0d8cafe8ed58c888e..7ff397461f0b5b6397f6aab800c7f738045643c8 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/SadTabTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/SadTabTest.java
@@ -8,7 +8,6 @@ import android.test.suitebuilder.annotation.SmallTest;
import android.widget.Button;
import org.chromium.base.ThreadUtils;
-import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.R;
@@ -59,12 +58,14 @@ public class SadTabTest extends ChromeActivityTestCaseBase<ChromeActivity> {
/**
* Confirm that after a successive refresh of a failed tab that failed to load, change the
- * button from "Reload" to "Send Feedback".
+ * button from "Reload" to "Send Feedback". If reloaded a third time and it is successful it
+ * reverts from "Send Feedback" to "Reload".
+ * @throws InterruptedException
+ * @throws IllegalArgumentException
*/
@SmallTest
@Feature({"SadTab"})
- @DisabledTest(message = "crbug.com/670920")
- public void testChangeSadButtonToFeedbackAfterFailedRefresh() {
+ public void testSadTabPageButtonText() throws IllegalArgumentException, InterruptedException {
final Tab tab = getActivity().getActivityTab();
assertFalse(tab.isShowingSadTab());
@@ -81,30 +82,13 @@ public class SadTabTest extends ChromeActivityTestCaseBase<ChromeActivity> {
"Expected the sad tab button to have the feedback label after the tab button "
+ "crashes twice in a row.",
getActivity().getString(R.string.sad_tab_send_feedback_label), actualText);
- }
-
- /**
- * Confirm after two failures, if we refresh a third time and it's successful, and then we
- * crash again, we do not show the "Send Feedback" button and instead show the "Reload" tab.
- */
- @SmallTest
- @Feature({"SadTab"})
- @DisabledTest(message = "crbug.com/670920")
- public void testSadButtonRevertsBackToReloadAfterSuccessfulLoad() {
- final Tab tab = getActivity().getActivityTab();
-
- simulateRendererKilled(tab, true);
- reloadSadTab(tab);
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- tab.reload(); // Erases the sad tab page
- tab.didFinishPageLoad(); // Resets the tab counter to 0
- }
- });
+ loadUrl("about:blank");
+ assertFalse("Expected about:blank to destroy the sad tab however the sad tab is still in "
+ + "view", tab.isShowingSadTab());
simulateRendererKilled(tab, true);
- String actualText = getSadTabButton(tab).getText().toString();
- assertEquals(getActivity().getString(R.string.sad_tab_reload_label), actualText);
+ actualText = getSadTabButton(tab).getText().toString();
+ assertEquals("Expected the sad tab button to have the reload label after a successful load",
+ getActivity().getString(R.string.sad_tab_reload_label), actualText);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698