summaryrefslogtreecommitdiffstats
path: root/toolkit/content/tests/browser/browser_autoscroll_disabled.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:55:19 +0200
commiteb70e6e3d0bff11c25f14b1196025791bf2308fb (patch)
tree5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/content/tests/browser/browser_autoscroll_disabled.js
parent32ead795290b3399d56b4708fc75b77d296f6a1a (diff)
downloadUXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/content/tests/browser/browser_autoscroll_disabled.js')
-rw-r--r--toolkit/content/tests/browser/browser_autoscroll_disabled.js67
1 files changed, 0 insertions, 67 deletions
diff --git a/toolkit/content/tests/browser/browser_autoscroll_disabled.js b/toolkit/content/tests/browser/browser_autoscroll_disabled.js
deleted file mode 100644
index 07c6174ab..000000000
--- a/toolkit/content/tests/browser/browser_autoscroll_disabled.js
+++ /dev/null
@@ -1,67 +0,0 @@
-add_task(function* ()
-{
- const kPrefName_AutoScroll = "general.autoScroll";
- Services.prefs.setBoolPref(kPrefName_AutoScroll, false);
-
- let dataUri = 'data:text/html,<html><body id="i" style="overflow-y: scroll"><div style="height: 2000px"></div>\
- <iframe id="iframe" style="display: none;"></iframe>\
-</body></html>';
-
- let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- gBrowser.loadURI(dataUri);
- yield loadedPromise;
-
- yield BrowserTestUtils.synthesizeMouse("#i", 50, 50, { button: 1 },
- gBrowser.selectedBrowser);
-
- yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* () {
- var iframe = content.document.getElementById("iframe");
-
- if (iframe) {
- var e = new iframe.contentWindow.PageTransitionEvent("pagehide",
- { bubbles: true,
- cancelable: true,
- persisted: false });
- iframe.contentDocument.dispatchEvent(e);
- iframe.contentDocument.documentElement.dispatchEvent(e);
- }
- });
-
- yield BrowserTestUtils.synthesizeMouse("#i", 100, 100,
- { type: "mousemove", clickCount: "0" },
- gBrowser.selectedBrowser);
-
- // If scrolling didn't work, we wouldn't do any redraws and thus time out, so
- // request and force redraws to get the chance to check for scrolling at all.
- yield new Promise(resolve => window.requestAnimationFrame(resolve));
-
- let msg = yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* () {
- // Skip the first animation frame callback as it's the same callback that
- // the browser uses to kick off the scrolling.
- return new Promise(resolve => {
- function checkScroll() {
- let msg = "";
- let elem = content.document.getElementById('i');
- if (elem.scrollTop != 0) {
- msg += "element should not have scrolled vertically";
- }
- if (elem.scrollLeft != 0) {
- msg += "element should not have scrolled horizontally";
- }
-
- resolve(msg);
- }
-
- content.requestAnimationFrame(checkScroll);
- });
- });
-
- ok(!msg, "element scroll " + msg);
-
- // restore the changed prefs
- if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll))
- Services.prefs.clearUserPref(kPrefName_AutoScroll);
-
- // wait for focus to fix a failure in the next test if the latter runs too soon.
- yield SimpleTest.promiseFocus();
-});