From 948be26a925a30b431ac1717be31111b374f9bbd Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Thu, 30 Sep 2010 11:07:37 -0700 Subject: [PATCH] Bug 600871 - Fix timeout in browser_bookmarks.js test [r=mfinkle] --HG-- extra : rebase_source : d84d795e061411dc2c99a92434dc68b645435625 --- mobile/chrome/tests/browser_bookmarks.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mobile/chrome/tests/browser_bookmarks.js b/mobile/chrome/tests/browser_bookmarks.js index e851708c198..37d9e01a003 100644 --- a/mobile/chrome/tests/browser_bookmarks.js +++ b/mobile/chrome/tests/browser_bookmarks.js @@ -82,7 +82,7 @@ gTests.push({ _currentTab: null, run: function() { - this._currentTab = Browser.addTab(testURL_01, true); + this._currentTab = Browser.addTab(testURL_02, true); // Need to wait until the page is loaded messageManager.addMessageListener("pageshow", function(aMessage) { @@ -101,6 +101,13 @@ gTests.push({ }, onBookmarksReady: function() { + let bookmarkitem = document.getAnonymousElementByAttribute(BookmarkList.panel, "uri", testURL_01); + bookmarkitem.control.scrollBoxObject.ensureElementIsVisible(bookmarkitem); + + isnot(bookmarkitem, null, "Found the bookmark"); + is(bookmarkitem.getAttribute("uri"), testURL_01, "Bookmark has the right URL via attribute"); + is(bookmarkitem.spec, testURL_01, "Bookmark has the right URL via property"); + // Create a listener for the opening bookmark messageManager.addMessageListener("pageshow", function(aMessage) { messageManager.removeMessageListener(aMessage.name, arguments.callee); @@ -111,11 +118,6 @@ gTests.push({ runNextTest(); }); - let bookmarkitem = document.getAnonymousElementByAttribute(BookmarkList.panel, "uri", testURL_01); - isnot(bookmarkitem, null, "Found the bookmark"); - is(bookmarkitem.getAttribute("uri"), testURL_01, "Bookmark has the right URL via attribute"); - is(bookmarkitem.spec, testURL_01, "Bookmark has the right URL via property"); - EventUtils.synthesizeMouse(bookmarkitem, bookmarkitem.width / 2, bookmarkitem.height / 2, {}); } });