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

Unified Diff: PRESUBMIT_test.py

Issue 2627023003: Add presubmit check for Google support URL format. (Closed)
Patch Set: test Created 3 years, 11 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
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT_test.py
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 1b5fd316720d4e15dcc219375ad489c2f5f409cb..7f3ee91a4bbdbd2d71952a974c6e0e810ffdb21e 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -1131,6 +1131,36 @@ class LogUsageTest(unittest.TestCase):
self.assertTrue('HasDottedTag.java' in msgs[4].items)
self.assertTrue('HasOldTag.java' in msgs[4].items)
+class GoogleAnswerUrlFormatTest(unittest.TestCase):
+
+ def testCatchAnswerUrlId(self):
+ input_api = MockInputApi()
+ input_api.files = [
+ MockFile('somewhere/file.cc',
+ ['char* host = '
+ ' "https://support.google.com/chrome/answer/123456";']),
+ MockFile('somewhere_else/file.cc',
+ ['char* host = '
+ ' "https://support.google.com/chrome/a/answer/123456";']),
+ ]
+
+ warnings = PRESUBMIT._CheckGoogleSupportAnswerUrl(
+ input_api, MockOutputApi())
+ self.assertEqual(1, len(warnings))
+ self.assertEqual(2, len(warnings[0].items))
+
+ def testAllowAnswerUrlParam(self):
+ input_api = MockInputApi()
+ input_api.files = [
+ MockFile('somewhere/file.cc',
+ ['char* host = '
+ ' "https://support.google.com/chrome/?p=cpn_crash_reports";']),
+ ]
+
+ warnings = PRESUBMIT._CheckGoogleSupportAnswerUrl(
+ input_api, MockOutputApi())
+ self.assertEqual(0, len(warnings))
+
class HardcodedGoogleHostsTest(unittest.TestCase):
def testWarnOnAssignedLiterals(self):
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698