Add presubmit check for png files

This CL adds a presubmit check for png files so that they are in the form
_expected{,_mac,_win}.pdf.BLA.png and updates the corpus test repository hash.

Change-Id: I5397a091b77a339eba7d370b291b7a6e61754744
Reviewed-on: https://pdfium-review.googlesource.com/6951
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
diff --git a/DEPS b/DEPS
index a418c66..e8d0209 100644
--- a/DEPS
+++ b/DEPS
@@ -19,7 +19,7 @@
   'jinja2_revision': 'd34383206fa42d52faa10bb9931d6d538f3a57e0',
   'jpeg_turbo_revision': '7260e4d8b8e1e40b17f03fafdf1cd83296900f76',
   'markupsafe_revision': '8f45f5cfa0009d2a70589bcda0349b8cb2b72783',
-  'pdfium_tests_revision': 'f1ccbbfbc586e0ead482d286946d2f085503782f',
+  'pdfium_tests_revision': 'b56d3ca8b0af647ef73814543ee69b6161e7af08',
   'skia_revision': 'bb581ce30f55360fd3a12e7f5aa1fe324b16d085',
   'tools_memory_revision': '427f10475e1a8d72424c29d00bf689122b738e5d',
   'trace_event_revision': '06294c8a4a6f744ef284cd63cfe54dbf61eea290',
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 26d559a..e8d8458 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -267,7 +267,7 @@
       end_len = 4
     else:
       continue
-    path = f.LocalPath()[:-end_len];
+    path = f.LocalPath()[:-end_len]
     if path in tests_added:
       results.append(output_api.PresubmitError(
           'Remove %s to prevent shadowing %s' % (path + '.pdf',
@@ -276,6 +276,21 @@
       tests_added.append(path)
   return results
 
+def _CheckPNGFormat(input_api, output_api):
+  """Checks that .png files have a format that will be considered valid by our
+  test runners. If a file ends with .png, then it must be of the form
+  NAME_expected{,mac,win}.pdf.#.png"""
+  expected_pattern = input_api.re.compile(
+      r'.*_expected(_(mac|win))?\.pdf\..*\.png')
+  results = []
+  for f in input_api.AffectedFiles():
+    if not f.LocalPath().endswith('.png'):
+      continue
+    if expected_pattern.match(f.LocalPath()):
+      continue
+    results.append(output_api.PresubmitError(
+        'PNG file %s does not have the correct format' % f.LocalPath()))
+  return results
 
 def CheckChangeOnUpload(input_api, output_api):
   results = []
@@ -285,5 +300,6 @@
       input_api, output_api, None, LINT_FILTERS)
   results += _CheckIncludeOrder(input_api, output_api)
   results += _CheckTestDuplicates(input_api, output_api)
+  results += _CheckPNGFormat(input_api, output_api)
 
   return results
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index 1ae9613..309ab21 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -296,8 +296,12 @@
 Choose.pdf * * *
 data_binding.pdf * * *
 Date_FormCale.pdf * * *
+# TODO(npm): Add proper evt for MouseEvents.
+MouseEvents_enter.pdf * * *
+MouseEvents_exit.pdf * * *
+Oneof3.pdf * * *
 Sum.pdf * * *
 TimeField.pdf win,linux * *
 Test_CheckBox.pdf * * *
 Test_DateField_locale_zh_HK.pdf mac,win * *
-Oneof3.pdf * * *
+