Add safetynet_job.py to run safetynet_compare.py periodically.

safetynet.job.py verifies if there were performance changes since
its last run. Its state is comprised only of the last checkpoint,
and is kept in a directory passed by argument. Results of runs are
written to this directory as well.

Change-Id: I94e0e176b10fd1d2b18d84f82427f63be107ae17
Reviewed-on: https://pdfium-review.googlesource.com/10370
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/testing/tools/githelper.py b/testing/tools/githelper.py
index 42cc57d..021ed4e 100644
--- a/testing/tools/githelper.py
+++ b/testing/tools/githelper.py
@@ -17,6 +17,10 @@
     """Checks out a branch."""
     subprocess.check_output(['git', 'checkout', branch])
 
+  def FetchOriginMaster(self):
+    """Fetches new changes on origin/master."""
+    subprocess.check_output(['git', 'fetch', 'origin', 'master'])
+
   def StashPush(self):
     """Stashes uncommitted changes."""
     output = subprocess.check_output(['git', 'stash', '--include-untracked'])
@@ -37,6 +41,14 @@
     return subprocess.check_output(
         ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip()
 
+  def GetCurrentBranchHash(self):
+    return subprocess.check_output(
+        ['git', 'rev-parse', 'HEAD']).strip()
+
+  def IsCurrentBranchClean(self):
+    output = subprocess.check_output(['git', 'status', '--porcelain'])
+    return not output
+
   def BranchExists(self, branch_name):
     """Return whether a branch with the given name exists."""
     try: