Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: components/domain_reliability/bake_in_configs.py

Issue 391383003: Domain Reliability: Update baked-in configs, add more (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add contact info to AddBakedInConfigs test Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/domain_reliability/bake_in_configs.py
diff --git a/components/domain_reliability/bake_in_configs.py b/components/domain_reliability/bake_in_configs.py
index 5cc784c7356fbc15f4dba6813240a0f6abe786ef..937fce57a1eafc9ff2d58a53beedf451d4695d42 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)
« no previous file with comments | « components/domain_reliability.gypi ('k') | components/domain_reliability/baked_in_configs/accounts_google_com.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698