Bug 1175266 - Wait for the binding to be attached before proceeding in browser_trackingUI.js to fix local failures;r=MattN

--HG--
extra : commitid : 4fV7JlceZQn
This commit is contained in:
Brian Grinstead 2015-06-16 20:10:02 -07:00
Родитель 5dbf07ac86
Коммит e553bcf852
1 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -58,15 +58,23 @@ function testBenignPage(gTestBrowser)
is(notification, null, "Tracking Content Doorhanger did NOT appear when protection was ON and tracking was NOT present");
}
function testTrackingPage(gTestBrowser)
function* testTrackingPage(gTestBrowser)
{
// Make sure the doorhanger appears
var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
isnot(notification, null, "Tracking Content Doorhanger did appear when protection was ON and tracking was present");
notification.reshow();
// Wait for the method to be attached after showing the popup
yield promiseWaitForCondition(() => {
return PopupNotifications.panel.firstChild.disableTrackingContentProtection;
});
// Make sure the state of the doorhanger includes blocking tracking elements
isnot(PopupNotifications.panel.firstChild.isTrackingContentBlocked, 0,
"Tracking Content is being blocked");
is(PopupNotifications.panel.firstChild.isTrackingContentBlocked,
Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT,
"Tracking Content is being blocked");
// Make sure the notification has no trackingblockdisabled attribute
ok(!PopupNotifications.panel.firstChild.hasAttribute("trackingblockdisabled"),
@ -127,7 +135,7 @@ add_task(function* () {
// Point tab to a test page containing tracking elements
yield promiseTabLoadEvent(tab, "http://tracking.example.org/browser/browser/base/content/test/general/trackingPage.html");
testTrackingPage(gBrowser.getBrowserForTab(tab));
yield testTrackingPage(gBrowser.getBrowserForTab(tab));
// Wait for tab to reload following tracking-protection page white-listing
yield promiseTabLoadEvent(tab);