tenfourfox/testing/eslint-plugin-mozilla/docs/no-cpows-in-tests.rst
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

26 lines
630 B
ReStructuredText

.. _no-cpows-in-tests:
=================
no-cpows-in-tests
=================
Rule Details
------------
This rule checks if the file is a browser mochitest and, if so, checks for
possible CPOW usage by checking for the following strings:
- "gBrowser.contentWindow"
- "gBrowser.contentDocument"
- "gBrowser.selectedBrowser.contentWindow"
- "browser.contentDocument"
- "window.content"
- "content"
- "content."
Note: These are string matches so we will miss situations where the parent
object is assigned to another variable e.g.::
var b = gBrowser;
b.content // Would not be detected as a CPOW.