зеркало из https://github.com/mozilla/gecko-dev.git
Bug 521557 - enable browser_keyevents_during_autoscrolling.js on Linux
This commit is contained in:
Родитель
441c2ab877
Коммит
ddb3d725e4
|
@ -52,13 +52,8 @@ include $(topsrcdir)/config/rules.mk
|
|||
|
||||
_BROWSER_FILES = \
|
||||
browser_bug471962.js \
|
||||
browser_keyevents_during_autoscrolling.js \
|
||||
$(NULL)
|
||||
|
||||
# browser_keyevents_during_autoscrolling.js cannot start the autoscrolling by
|
||||
# synthesizeMouse with middle button on linux, therefore, disable it temporarily
|
||||
ifneq ($(MOZ_WIDGET_TOOLKIT),gtk2)
|
||||
_BROWSER_FILES += browser_keyevents_during_autoscrolling.js
|
||||
endif
|
||||
|
||||
libs:: $(_BROWSER_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
|
||||
|
|
|
@ -133,7 +133,7 @@ function test() {
|
|||
}
|
||||
finally {
|
||||
// Replace the current tab with a clean one.
|
||||
gBrowser.addTab();
|
||||
gBrowser.addTab().linkedBrowser.stop();
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
function test()
|
||||
{
|
||||
const kPrefName_AutoScroll = "general.autoScroll";
|
||||
const kPrefName_ContentLoadURL = "middlemouse.contentLoadURL";
|
||||
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch2);
|
||||
var kAutoScrollingEnabled = prefSvc.getBoolPref(kPrefName_AutoScroll);
|
||||
prefSvc.setBoolPref(kPrefName_AutoScroll, true);
|
||||
|
||||
const kNoKeyEvents = 0;
|
||||
|
@ -53,18 +51,17 @@ function test()
|
|||
is(keyFlag, expectedKeyEvents & keyFlag, aEvent.type + " fired: " + key);
|
||||
}
|
||||
|
||||
function startTest() {
|
||||
waitForExplicitFinish();
|
||||
gBrowser.addEventListener("load", onLoad, false);
|
||||
var dataUri = 'data:text/html,<body style="height:10000px;"></body>';
|
||||
gBrowser.loadURI(dataUri);
|
||||
}
|
||||
waitForExplicitFinish();
|
||||
gBrowser.addEventListener("load", onLoad, false);
|
||||
var dataUri = 'data:text/html,<body style="height:10000px;"></body>';
|
||||
gBrowser.loadURI(dataUri);
|
||||
|
||||
function onLoad() {
|
||||
gBrowser.removeEventListener("load", onLoad, false);
|
||||
waitForFocus(onFocus, content);
|
||||
}
|
||||
|
||||
gBrowser.contentWindow.focus();
|
||||
|
||||
function onFocus() {
|
||||
var doc = gBrowser.contentDocument;
|
||||
|
||||
root = doc.documentElement;
|
||||
|
@ -106,13 +103,12 @@ function test()
|
|||
root.removeEventListener("keyup", onKey, true);
|
||||
|
||||
// restore the changed prefs
|
||||
prefSvc.setBoolPref(kPrefName_AutoScroll, kAutoScrollingEnabled);
|
||||
prefSvc.clearUserPref(kPrefName_AutoScroll);
|
||||
|
||||
// cleaning-up
|
||||
gBrowser.loadURI("about:blank");
|
||||
gBrowser.addTab().linkedBrowser.stop();
|
||||
gBrowser.removeCurrentTab();
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
startTest();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче