зеркало из https://github.com/mozilla/gecko-dev.git
Bug 863347 - Remove about:home from default bookmarks. r=wesj
* * * TEMP. Try getAllPagesList(..., -1);
This commit is contained in:
Родитель
08669a8382
Коммит
11d7896e85
|
@ -269,9 +269,6 @@
|
|||
<string name="bookmarkdefaults_url_support">http://support.mozilla.org/@AB_CD@/products/mobile</string>
|
||||
<string name="bookmarkdefaults_favicon_abouthome">chrome/chrome/content/branding/favicon64.png</string>
|
||||
|
||||
<string name="bookmarkdefaults_title_abouthome">@bookmarks_aboutHome@</string>
|
||||
<string name="bookmarkdefaults_url_abouthome">about:home</string>
|
||||
|
||||
<!-- Site identity popup -->
|
||||
<string name="identity_connected_to">&identity_connected_to;</string>
|
||||
<string name="identity_run_by">&identity_run_by;</string>
|
||||
|
|
|
@ -45,6 +45,19 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
|
|||
private static final int MAX_WAIT_ENABLED_TEXT_MS = 10000;
|
||||
public static final int MAX_WAIT_MS = 3000;
|
||||
|
||||
// Note: DEFAULT_BOOKMARKS_TITLES.length == DEFAULT_BOOKMARKS_URLS.length
|
||||
protected static final String[] DEFAULT_BOOKMARKS_TITLES = new String[] {
|
||||
"Firefox: About your browser",
|
||||
"Firefox: Support",
|
||||
"Firefox: Customize with add-ons"
|
||||
};
|
||||
protected static final String[] DEFAULT_BOOKMARKS_URLS = new String[] {
|
||||
"about:firefox",
|
||||
"http://support.mozilla.org/en-US/products/mobile",
|
||||
"https://addons.mozilla.org/en-US/android/"
|
||||
};
|
||||
protected static final int DEFAULT_BOOKMARKS_COUNT = DEFAULT_BOOKMARKS_TITLES.length;
|
||||
|
||||
private static Class<Activity> mLauncherActivityClass;
|
||||
private Activity mActivity;
|
||||
protected Solo mSolo;
|
||||
|
|
|
@ -24,12 +24,7 @@ public class testAllPagesTab extends BaseTest {
|
|||
private static final String ABOUT_HOME_URL = "about:home";
|
||||
private static ListView listview = null;
|
||||
|
||||
private String[] mBookmarks = new String[] {
|
||||
"Firefox: About your browser",
|
||||
"Firefox Start",
|
||||
"Firefox: Support",
|
||||
"Firefox: Customize with add-ons"
|
||||
};
|
||||
private static int topSitesCount = DEFAULT_BOOKMARKS_COUNT;
|
||||
|
||||
@Override
|
||||
protected int getTestType() {
|
||||
|
@ -42,14 +37,15 @@ public class testAllPagesTab extends BaseTest {
|
|||
// load one page so there is something in our history
|
||||
String url = getAbsoluteUrl("/robocop/robocop_big_link.html");
|
||||
loadUrl(url);
|
||||
topSitesCount += 1; // Increment for "Big Link" Top Site since the URL was loaded above.
|
||||
|
||||
testList(url);
|
||||
testClick("about:firefox");
|
||||
testClick(DEFAULT_BOOKMARKS_URLS[0]);
|
||||
testContextMenu(url);
|
||||
}
|
||||
|
||||
private void testList(String url) {
|
||||
final ListView list = getAllPagesList(mBookmarks[0], 5);
|
||||
final ListView list = getAllPagesList(DEFAULT_BOOKMARKS_TITLES[0], topSitesCount);
|
||||
|
||||
// some basic checks for the tab strip
|
||||
TabWidget tabwidget = (TabWidget)mSolo.getView(TabWidget.class, 0);
|
||||
|
@ -61,7 +57,8 @@ public class testAllPagesTab extends BaseTest {
|
|||
// This test fails, only when we're running tests
|
||||
// mAsserter.is(host.getCurrentTab(), 0, "All pages tab is selected in tab strip");
|
||||
|
||||
mAsserter.isnot(list, null, "checking that all pages list exists and has 5 children (the default bookmarks)");
|
||||
mAsserter.isnot(list, null, "checking that all pages list exists and has " +
|
||||
topSitesCount + " children (the default bookmarks)");
|
||||
final int count = list.getAdapter().getCount();
|
||||
|
||||
String loadUrl = "";
|
||||
|
@ -87,7 +84,7 @@ public class testAllPagesTab extends BaseTest {
|
|||
loadUrl = string;
|
||||
}
|
||||
|
||||
if (isBookmark(mBookmarks, string)) {
|
||||
if (isBookmark(DEFAULT_BOOKMARKS_TITLES, string)) {
|
||||
expectedImages = 2;
|
||||
}
|
||||
} else if (v instanceof ImageView) {
|
||||
|
@ -108,7 +105,7 @@ public class testAllPagesTab extends BaseTest {
|
|||
}
|
||||
|
||||
private void testContextMenu(String url) {
|
||||
ListView list = getAllPagesList(mBookmarks[0], 5);
|
||||
ListView list = getAllPagesList(DEFAULT_BOOKMARKS_TITLES[0], topSitesCount);
|
||||
|
||||
View child = list.getChildAt(0);
|
||||
mAsserter.ok(child != null, "first list item can be retrieved", child != null ? child.toString() : "null!");
|
||||
|
@ -125,7 +122,7 @@ public class testAllPagesTab extends BaseTest {
|
|||
}
|
||||
|
||||
private void testClick(String url) {
|
||||
ListView list = getAllPagesList(mBookmarks[0], 5);
|
||||
ListView list = getAllPagesList(DEFAULT_BOOKMARKS_TITLES[0], topSitesCount);
|
||||
|
||||
Actions.EventExpecter contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
|
||||
|
||||
|
|
|
@ -17,12 +17,6 @@ public class testBookmark extends PixelTest {
|
|||
private Method mAddBookmark;
|
||||
private Method mRemoveBookmark;
|
||||
private Method mIsBookmarked;
|
||||
private String[] defaultBookmarks = new String[] {
|
||||
"about:firefox",
|
||||
"about:home",
|
||||
"http://support.mozilla.org/en-US/products/mobile",
|
||||
"https://addons.mozilla.org/en-US/android/"
|
||||
};
|
||||
|
||||
@Override
|
||||
protected int getTestType() {
|
||||
|
@ -70,24 +64,26 @@ public class testBookmark extends PixelTest {
|
|||
blockForGeckoReady();
|
||||
|
||||
// Open the bookmark list and check the root folder view
|
||||
ListView bookmarksList = getBookmarksList(ABOUT_HOME_URL, 4);
|
||||
ListView bookmarksList = getBookmarksList(ABOUT_HOME_URL, DEFAULT_BOOKMARKS_COUNT);
|
||||
|
||||
mAsserter.ok(bookmarksList != null, "checking that bookmarks list exists", "bookmarks list exists and has 4 children (the default bookmarks)");
|
||||
mAsserter.ok(bookmarksList != null, "checking that bookmarks list exists", "bookmarks list exists and has " +
|
||||
DEFAULT_BOOKMARKS_COUNT + " children (the default bookmarks)");
|
||||
|
||||
// No folders should be visible if no desktop bookmarks exist
|
||||
int count = bookmarksList.getAdapter().getCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
Cursor c = (Cursor)bookmarksList.getItemAtPosition(i);
|
||||
String url = c.getString(c.getColumnIndexOrThrow("url"));
|
||||
mAsserter.ok(Arrays.binarySearch(defaultBookmarks, url) > -1,
|
||||
mAsserter.ok(Arrays.binarySearch(DEFAULT_BOOKMARKS_URLS, url) > -1,
|
||||
"Find default bookmark", "Default bookmark for " + url + " found");
|
||||
}
|
||||
|
||||
insertOneBookmark();
|
||||
waitForText(BOOKMARK_TITLE);
|
||||
|
||||
mAsserter.is(bookmarksList.getAdapter().getCount(), 5,
|
||||
"bookmarks list has 5 children (the default bookmarks and the new one)");
|
||||
final int bookmarksCount = DEFAULT_BOOKMARKS_COUNT + 1;
|
||||
mAsserter.is(bookmarksList.getAdapter().getCount(), bookmarksCount, "bookmarks list has " +
|
||||
bookmarksCount + " children (the default bookmarks and the new one)");
|
||||
|
||||
// Click on the bookmark we created and wait for the bookmarked page to load
|
||||
Actions.RepeatedEventExpecter paintExpecter = mActions.expectPaint();
|
||||
|
|
|
@ -42,8 +42,10 @@ public class testBookmarksTab extends BaseTest {
|
|||
|
||||
private void testList(String url) {
|
||||
View child;
|
||||
ListView list = getBookmarksList("about:firefox", 5);
|
||||
mAsserter.isnot(list, null, "checking that bookmarks list exists and has 5 children (defaults + a folder)");
|
||||
final int bookmarksCount = DEFAULT_BOOKMARKS_COUNT + 1;
|
||||
ListView list = getBookmarksList(DEFAULT_BOOKMARKS_URLS[0], bookmarksCount);
|
||||
mAsserter.isnot(list, null, "checking that bookmarks list exists and has " +
|
||||
bookmarksCount + " children (defaults + a folder)");
|
||||
|
||||
int count = list.getAdapter().getCount();
|
||||
for (int i = count - 1; i >= 0; i--) {
|
||||
|
|
|
@ -26,8 +26,4 @@
|
|||
# link title for https://support.mozilla.org/mobile
|
||||
#define bookmarks_support Firefox: Support
|
||||
|
||||
# LOCALIZATION NOTE (bookmarks_aboutHome):
|
||||
# link title for about:home
|
||||
#define bookmarks_aboutHome Firefox Start
|
||||
|
||||
#unfilter emptyLines
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
},
|
||||
{"index":3,"title":"@bookmarks_support@", "type":"text/x-moz-place", "uri":"http://support.mozilla.org/@AB_CD@/mobile",
|
||||
"icon":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAIYElEQVRYw5VXCVBUVxb9NZUqzWQWlVVl07hk3KKTmLikNMYoIAgiiGyuIBBHDSqOM2piYhCFGI0KLuNCEElRarMKDQ0NguiAiEJAIqKARjQ4fFmCC9Bw5r73f3fTIQTsqst7/fn97rnnrk8AcJdE7I9oNBrx1q1a8dz5HPHLr86IW7YeF4O3HBP/vf2kePCQQszNKxXrnzSK/T2P6RboTwv6+Dx61IAD316Arf1WWI/0hLGZC4aYLuKrsdliGNF+iMkimFsswcTJfghcewAEBhpNZ19Htwgykt/8NDe3YueX32HcxFWkxAXmw91gNcITNm96yeIti7S3HukFC+ulHBgD4+i0DVeulv8eALFXANeLK/GxbTAGGTvToR7dlHl3A+AF6257g+cExnToYg4odE8sOjo0/QegyiyCzShvOsC1h8LhVkthYr4Y5iSWxIi1pRsshrvCjKxm71vYeBi8b0mMDTJyxirfcPzyy/O+AeTmlmAEKR9m6W5A7zBSbEYKZk8PxOYNB3EsWoXvLl7D6YybiEouROTJNKz1C8PUyathQnFhyYCM0oP/q5ET/Pz3obOzq3cAVVUPMXbcSgwl/3W33JisnTHVHzHRSpyuaoT3HQ3Gl2pgXtQOo2ttGHq9E1PKgNVVwPcVTThyUIFxY31gOsyNG6M9iwVqyO6Y3wbAItZ7WSgPoO7I2fdl7juRVvkz3O4BQnYrBFUzhEySLBJ1G+0fQ1DmQEhNw2vqYvjWdiKpoBoO8zbChFjTgmABbEZuy8oq7gmAcpsj7B7hTPl6v71Ie/ISRv99CSGjiRQ26yWbPbsCIdEHQvxHsnwMQeGPsdcroKxpxYK5QZwJGxmEGe3nzN2EtrZ2PYD29g6K+C08zbR0mQ9fAn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qChoVkC0Nr6AumqaygoqMCJkxf5UDHgj3bYHxqD0AZiIYkqX8pe2e+/o1hFcXCpFeNLNAi804bD5Q1QldTgk4B9vCtqCx1j+NONEYbdMCw8jveDU1FKZOfc4LX6HYqNtOR8bHpIilOpKGW19GJxE/6Q+wzuVZ2Iud2A4zGZ8PX5Ch/QDDGaAq/7cMNYYAyUlNw1BKBIyJOGSfLN1/vikJFxDersGzjwTRxuFP2I4LsaDGDKWEtWaUX6PqboJWIq/4eI/XH44D1//XhGin49xDLrl6/a23MeYOPSIBqbWD1gVYqBmfJuAE6cSsXVK2VsZEE5TVO+NYBjZRfsSRwqOxFQC2RX1cNu1joMpgGWxZLh1KzfMyb+NmElqmse9wTw08MnsF2wFUZmLrofssMYqMORCXjwoB5pSXk4EBaL8NCzCKdJd09INLZtjsC8j4J48HafpAwBeNNw6sFZUSjyep8J6+ufwo4642B5MmJV0dF5O5/tWYke+IY9D86Bb9jxVbv/y+CFPHOseyj35qBYg2PN59Dh+L6nYkoNCsAQXihYUL43/R/Izy/DN/vPIYQsp2sYtvzzGL7YFY09e2Oxm5jY/tkpeHqH4M0xy+SeorecxRSj/sjRpP7fC9glgu59PBaYX6fNWIeAT/aD7oF0U4qWgGw7gY2bIhFEsuPz04g5q8L0met0zYatg03ot/SMCs6r34zYJ01ZAKdFOziFA/9kj9dJ/jzIkbPDwGnFWBf1HjzfWZ2f8LYvdhAzDQ1NfV7N+ryc3qH7QuSRRM7C3PnBumLC/M7ugEZmEpCx41bQaL8bZ2JUoFsy+vHhl9O7r3CdZhO0+ENZtUhuEB0WbhMpaMUNGyPE+ITLYu39n1/las6v5/8HR4lI9EcypCoAAAAASUVORK5CYII="
|
||||
},
|
||||
{"index":4,"title":"@bookmarks_aboutHome@", "type":"text/x-moz-place", "uri":"about:home",
|
||||
"iconUri":"chrome://branding/content/favicon32.png"
|
||||
}
|
||||
]
|
||||
}]
|
||||
|
|
Загрузка…
Ссылка в новой задаче