Bug 1038996 - Don't prepopulate the address bar with 'about:home', and 'about:privatebrowsing' on new tabs; they should be a placeholder. r=mcomella
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.mozilla.gecko.toolbar;
|
||||
|
||||
import org.mozilla.gecko.AboutPages;
|
||||
import org.mozilla.gecko.AppConstants.Versions;
|
||||
import org.mozilla.gecko.CustomEditText;
|
||||
import org.mozilla.gecko.InputMethods;
|
||||
@@ -122,7 +123,17 @@ public class ToolbarEditText extends CustomEditText
|
||||
|
||||
@Override
|
||||
public void setText(final CharSequence text, final TextView.BufferType type) {
|
||||
super.setText(text, type);
|
||||
final String textString = (text == null) ? "" : text.toString();
|
||||
|
||||
// If we're on the home or private browsing page, we don't set the "about" url.
|
||||
final CharSequence finalText;
|
||||
if (AboutPages.isAboutHome(textString) || AboutPages.isAboutPrivateBrowsing(textString)) {
|
||||
finalText = "";
|
||||
} else {
|
||||
finalText = text;
|
||||
}
|
||||
|
||||
super.setText(finalText, type);
|
||||
|
||||
// Any autocomplete text would have been overwritten, so reset our autocomplete states.
|
||||
resetAutocompleteState();
|
||||
|
||||
@@ -184,7 +184,7 @@ abstract class BaseTest extends BaseRobocopTest {
|
||||
|
||||
// Send the keys for the URL we want to enter
|
||||
mSolo.clearEditText(urlEditView);
|
||||
mSolo.enterText(urlEditView, url);
|
||||
mSolo.typeText(urlEditView, url);
|
||||
|
||||
// Get the URL text from the URL bar EditText view
|
||||
final String urlBarText = urlEditView.getText().toString();
|
||||
|
||||
@@ -23,7 +23,7 @@ public final class testInputUrlBar extends BaseTest {
|
||||
blockForGeckoReady();
|
||||
|
||||
startEditingMode();
|
||||
assertUrlBarText(mStringHelper.ABOUT_HOME_URL);
|
||||
assertUrlBarText("");
|
||||
|
||||
// Avoid any auto domain completion by using a prefix that matches
|
||||
// nothing, including about: pages
|
||||
@@ -97,7 +97,7 @@ public final class testInputUrlBar extends BaseTest {
|
||||
|
||||
// URL bar should have forgotten about "uv" text.
|
||||
startEditingMode();
|
||||
assertUrlBarText(mStringHelper.ABOUT_HOME_URL);
|
||||
assertUrlBarText("");
|
||||
|
||||
int width = mDriver.getGeckoWidth() / 2;
|
||||
int y = mDriver.getGeckoHeight() / 2;
|
||||
|
||||
Reference in New Issue
Block a user