toolkit/crashreporter/test/browser/browser_aboutCrashes.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 function check_crash_list(tab, crashes) {
michael@0 2 let doc = gBrowser.getBrowserForTab(tab).contentDocument;
michael@0 3 let crashlinks = doc.getElementById("tbody").getElementsByTagName("a");
michael@0 4 is(crashlinks.length, crashes.length, "about:crashes lists correct number of crash reports");
michael@0 5 for(let i = 0; i < crashes.length; i++) {
michael@0 6 is(crashlinks[i].firstChild.textContent, crashes[i].id, i + ": crash ID is correct");
michael@0 7 }
michael@0 8 cleanup_fake_appdir();
michael@0 9 gBrowser.removeTab(tab);
michael@0 10 finish();
michael@0 11 }
michael@0 12
michael@0 13 function test() {
michael@0 14 waitForExplicitFinish();
michael@0 15 let appD = make_fake_appdir();
michael@0 16 let crD = appD.clone();
michael@0 17 crD.append("Crash Reports");
michael@0 18 let crashes = add_fake_crashes(crD, 5);
michael@0 19 // sanity check
michael@0 20 let dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
michael@0 21 .getService(Components.interfaces.nsIProperties);
michael@0 22 let appDtest = dirSvc.get("UAppData", Components.interfaces.nsILocalFile);
michael@0 23 ok(appD.equals(appDtest), "directory service provider registered ok");
michael@0 24 let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
michael@0 25 let browser = gBrowser.getBrowserForTab(tab);
michael@0 26 browser.addEventListener("load", function() {
michael@0 27 browser.removeEventListener("load", arguments.callee, true);
michael@0 28 ok(true, "about:crashes loaded");
michael@0 29 executeSoon(function() { check_crash_list(tab, crashes); });
michael@0 30 }, true);
michael@0 31 browser.loadURI("about:crashes", null, null);
michael@0 32 }

mercurial