diff options
author | ttuttle@chromium.org <ttuttle@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-17 06:18:36 +0000 |
---|---|---|
committer | ttuttle@chromium.org <ttuttle@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-17 06:18:36 +0000 |
commit | 14db34f1928fa6ede7648c9aef77285339e34510 (patch) | |
tree | e3b2e04fb42643aacc43b9dfc062dc449cc42652 /components/domain_reliability/bake_in_configs.py | |
parent | c32d30cbadfc1655c1b7b40df65362313b1e9a7b (diff) | |
download | chromium_src-14db34f1928fa6ede7648c9aef77285339e34510.zip chromium_src-14db34f1928fa6ede7648c9aef77285339e34510.tar.gz chromium_src-14db34f1928fa6ede7648c9aef77285339e34510.tar.bz2 |
Domain Reliability: Update baked-in configs, add more
Add a bunch more baked-in configs, and update the existing ones.
Also, improve bake_in_configs.py so it will display multiple errors before
failing, and re-enable the unit test that failed when the existing configs
expired.
BUG=
Review URL: https://codereview.chromium.org/391383003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/domain_reliability/bake_in_configs.py')
-rwxr-xr-x | components/domain_reliability/bake_in_configs.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/components/domain_reliability/bake_in_configs.py b/components/domain_reliability/bake_in_configs.py index 5cc784c..937fce5 100755 --- a/components/domain_reliability/bake_in_configs.py +++ b/components/domain_reliability/bake_in_configs.py @@ -17,7 +17,10 @@ import sys # A whitelist of domains that the script will accept when baking configs in to # Chrome, to ensure incorrect ones are not added accidentally. Subdomains of # whitelist entries are also allowed (e.g. maps.google.com, ssl.gstatic.com). -DOMAIN_WHITELIST = ('google.com', 'gstatic.com', 'youtube.com') +DOMAIN_WHITELIST = ('2mdn.net', 'admob.com', 'doubleclick.net', 'ggpht.com', + 'google.com', 'googleadservices.com', 'googleapis.com', + 'googlesyndication.com', 'googleusercontent.com', + 'googlevideo.com', 'gstatic.com', 'gvt1.com', 'youtube.com') CC_HEADER = """// Copyright (C) 2014 The Chromium Authors. All rights reserved. @@ -78,23 +81,29 @@ def main(): return 1 cpp_code = CC_HEADER + found_invalid_config = False for json_file in sys.argv[1:-1]: with open(json_file, 'r') as f: json_text = f.read() config = json.loads(json_text) if 'monitored_domain' not in config: - print >> sys.stderr ('%s: no monitored_domain found' % json_file) - return 1 + print >> sys.stderr, ('%s: no monitored_domain found' % json_file) + found_invalid_config = True + continue domain = config['monitored_domain'] if not domain_is_whitelisted(domain): - print >> sys.stderr ('%s: monitored_domain "%s" not in whitelist' % - (json_file, domain)) - return 1 + print >> sys.stderr, ('%s: monitored_domain "%s" not in whitelist' % + (json_file, domain)) + found_invalid_config = True + continue cpp_code += " // " + json_file + ":\n" cpp_code += quote_and_wrap_text(json_text) + ",\n" cpp_code += "\n" cpp_code += CC_FOOTER + if found_invalid_config: + return 1 + with open(sys.argv[-1], 'wb') as f: f.write(cpp_code) |