raphinesse commented on a change in pull request #1038:
URL: https://github.com/apache/cordova-android/pull/1038#discussion_r500122135
##########
File path:
test/android/app/src/androidTest/java/org/apache/cordova/unittests/BackButtonMultipageTest.java
##########
@@ -140,19 +142,28 @@ public void testViaBackButtonOnView() throws Throwable {
mActivityRule.runOnUiThread(new Runnable() {
public void run() {
-
webInterface.loadUrl("file:///android_asset/www/backbuttonmultipage/sample2.html");
+ webInterface.loadUrl(SAMPLE2_URL);
}
});
-
assertEquals("file:///android_asset/www/backbuttonmultipage/sample2.html",
mActivity.onPageFinishedUrl.take());
+ assertPageSample2();
mActivityRule.runOnUiThread(new Runnable() {
public void run() {
-
webInterface.loadUrl("file:///android_asset/www/backbuttonmultipage/sample3.html");
+ webInterface.loadUrl(SAMPLE3_URL);
}
});
-
assertEquals("file:///android_asset/www/backbuttonmultipage/sample3.html",
mActivity.onPageFinishedUrl.take());
+ assertPageSample3();
onView(withId(WEBVIEW_ID)).perform(pressBack());
-
assertEquals("file:///android_asset/www/backbuttonmultipage/sample2.html",
mActivity.onPageFinishedUrl.take());
+ assertPageSample2();
onView(withId(WEBVIEW_ID)).perform(pressBack());
assertEquals(START_URL, mActivity.onPageFinishedUrl.take());
}
+
+ private void assertPageSample3() {
Review comment:
I would prefer having a single helper `assertOnPage(String url)` and
then calling it with `SAMPLE2_URL` and `SAMPLE3_URL`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]