diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /toolkit/crashreporter/test/browser/browser_bug471404.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'toolkit/crashreporter/test/browser/browser_bug471404.js')
-rw-r--r-- | toolkit/crashreporter/test/browser/browser_bug471404.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/toolkit/crashreporter/test/browser/browser_bug471404.js b/toolkit/crashreporter/test/browser/browser_bug471404.js new file mode 100644 index 000000000..f0eb00b71 --- /dev/null +++ b/toolkit/crashreporter/test/browser/browser_bug471404.js @@ -0,0 +1,41 @@ +function check_clear_visible(browser, aVisible) { + return ContentTask.spawn(browser, aVisible, function (aVisible) { + let doc = content.document; + let visible = false; + let button = doc.getElementById("clear-reports"); + if (button) { + let style = doc.defaultView.getComputedStyle(button, ""); + if (style.display != "none" && + style.visibility == "visible") + visible = true; + } + Assert.equal(visible, aVisible, + "clear reports button is " + (aVisible ? "visible" : "hidden")); + }); +} + +// each test here has a setup (run before loading about:crashes) and onload (run after about:crashes loads) +var _tests = [{setup: null, onload: function(browser) { return check_clear_visible(browser, false); }}, + {setup: function(crD) { return add_fake_crashes(crD, 1); }, + onload: function(browser) { return check_clear_visible(browser, true); }} + ]; + +add_task(function* test() { + let appD = make_fake_appdir(); + let crD = appD.clone(); + crD.append("Crash Reports"); + + yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* (browser) { + for (let test of _tests) { + // Run setup before loading about:crashes. + if (test.setup) { + yield test.setup(crD); + } + + BrowserTestUtils.loadURI(browser, "about:crashes"); + yield BrowserTestUtils.browserLoaded(browser).then(() => test.onload(browser)); + } + }); + + cleanup_fake_appdir(); +}); |