.flake8
author Hiroyuki Ikezoe <hikezoe@mozilla.com>
Sat, 15 Sep 2018 01:00:07 +0000
changeset 492144 67a5acf7363d9dd2c8532967ec1beb0c200abc2c
parent 492060 c5fbbf959e23a4f33d450cb6c64ef739e09fbe13
child 499311 8e850a230bfcfb52e5dc15d146a402c7d8521ab8
permissions -rw-r--r--
Bug 1486971 - Test for dynamically change of the prefers-reduced-motion setting on MacOSX. r=froydnj,mstange The framework to simulate the setting change works as following; - nsIDOMWindowUtils.setPrefersReducedMotion() calls an IPC function which ends up calling nsChildView::SetPrefersReducedMotion() in the parent process - nsChildView::SetPrefersReducedMotion() sets the given value into nsLookAndFeel::mPrefersReducedMotionCached just like we set the value queried via NSWorkspace.accessibilityDisplayShouldReduceMotion in the parent process and send a notification which is the same notification MacOSX sends when the system setting changed - Normally the cached value is cleared before quering new values since the cache value is stale, but in this case the value is up-to-date one, so nsChildView::SetPrefersReducedMotion() tells that we don't need to clear the cache, and nsIDOMWindowUtils.resetPrefersReducedMotion() resets that state of 'we don't need to clear the cache' There are two test cases with the framework in this commit, one is just setting the value and checking the value queried by window.matchMedia. The other one is receiving 'change' event and checking the value of the event target. Note that to make this test works the patch for bug 1478212 is necessary since the test runs in an iframe. Depends on D5003 Differential Revision: https://phabricator.services.mozilla.com/D5004

[flake8]
# See http://pep8.readthedocs.io/en/latest/intro.html#configuration
ignore = E121, E123, E126, E129, E133, E226, E241, E242, E704, W503, E402, E741
max-line-length = 99
exclude =
    browser/extensions/mortar/ppapi/,
    browser/moz.configure,
    build/moz.configure/*.configure,
    build/pymake/,
    dom/canvas/test/webgl-conf/checkout/closure-library/,
    editor/libeditor/tests/browserscope/,
    intl/icu/,
    ipc/chromium/,
    gfx/angle/,
    gfx/harfbuzz,
    glx/skia/,
    js/*.configure,
    memory/moz.configure,
    mobile/android/*.configure,
    node_modules,
    security/nss/,
    testing/mochitest/pywebsocket,
    tools/lint/test/files,
    build/build-infer/build-infer.py,