Skip to content
Browse files

Constantize the JS threshold to make Yoono happy

  • Loading branch information...
1 parent d2fc1f2 commit c402e4a82cfa262f30fa6d8bb29a05be53caeee7 @mattbasta committed Oct 19, 2012
Showing with 6 additions and 1 deletion.
  1. +4 −0 validator/constants.py
  2. +2 −1 validator/testcases/content.py
View
4 validator/constants.py
@@ -51,6 +51,10 @@
# The maximum size of any string in JS analysis.
MAX_STR_SIZE = 1024 * 24 # 24KB
+# The maximum number of JS files that can be exhaustively validated in one
+# package.
+MAX_JS_THRESHOLD = 900
+
# Graciously provided by @kumar in bug 614574
if (not SPIDERMONKEY_INSTALLATION or
not os.path.exists(SPIDERMONKEY_INSTALLATION)):
View
3 validator/testcases/content.py
@@ -5,6 +5,7 @@
from regex import run_regex_tests
from validator.contextgenerator import ContextGenerator
+from validator.constants import MAX_JS_THRESHOLD
@robhudson
robhudson added a note Oct 22, 2012

s > t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
from validator import decorator
from validator import submain as testendpoint_validator
from validator import unicodehelper
@@ -203,7 +204,7 @@ def test_packed_scripts(err, xpi_package):
total_scripts = sum(len(bundle["scripts"]) for bundle in scripts)
exhaustive = True
- if total_scripts > 1000:
+ if total_scripts > MAX_JS_THRESHOLD:
err.warning(
err_id=("testcases_content", "packed_js", "too_much_js"),
warning="TOO MUCH JS FOR EXHAUSTIVE VALIDATION",

2 comments on commit c402e4a

@robhudson

r+ on this commit. Though I'm curious why you dropped it by 100?

@mattbasta
Owner

Previously, Yoono had > 1000 JS files. Now it has ~950. Bleh.

Please sign in to comment.
Something went wrong with that request. Please try again.