mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1071039 - Update TestSuggestedSites to check IDs. r=lucasr
This commit is contained in:
parent
bd0be3280e
commit
f2c2d89fb7
@ -152,6 +152,7 @@ public class TestSuggestedSites extends BrowserTestCase {
|
||||
try {
|
||||
for (int i = 0; i < n; i++) {
|
||||
JSONObject site = new JSONObject();
|
||||
site.put("trackingid", prefix + "trackingId" + i);
|
||||
site.put("url", prefix + "url" + i);
|
||||
site.put("title", prefix + "title" + i);
|
||||
site.put("imageurl", prefix + "imageUrl" + i);
|
||||
@ -238,6 +239,18 @@ public class TestSuggestedSites extends BrowserTestCase {
|
||||
checkCursorCount("{ broken: }", 0);
|
||||
}
|
||||
|
||||
public void testNoTrackingId() {
|
||||
String content = "[{ url: \"url\", title: \"title\", imageurl: \"imageurl\", bgcolor: \"bgcolor\" }]";
|
||||
resources.setSuggestedSitesResource(content);
|
||||
|
||||
Cursor c = new SuggestedSites(context).get(DEFAULT_LIMIT);
|
||||
assertEquals(1, c.getCount());
|
||||
c.moveToNext();
|
||||
|
||||
String trackingId = c.getString(c.getColumnIndexOrThrow(BrowserContract.SuggestedSites.TRACKING_ID));
|
||||
assertNull(trackingId);
|
||||
}
|
||||
|
||||
public void testCursorContent() {
|
||||
resources.setSuggestedSitesResource(generateSites(3));
|
||||
|
||||
@ -248,6 +261,9 @@ public class TestSuggestedSites extends BrowserTestCase {
|
||||
while (c.moveToNext()) {
|
||||
int position = c.getPosition();
|
||||
|
||||
String trackingId = c.getString(c.getColumnIndexOrThrow(BrowserContract.SuggestedSites.TRACKING_ID));
|
||||
assertEquals("trackingId" + position, trackingId);
|
||||
|
||||
String url = c.getString(c.getColumnIndexOrThrow(BrowserContract.SuggestedSites.URL));
|
||||
assertEquals("url" + position, url);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user