• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 The PDFium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4"""PDFium implementation of //build/skia_gold_common/skia_gold_properties.py."""
5
6import subprocess
7import sys
8
9import pdfium_root
10from skia_gold_common import skia_gold_properties
11
12
13class PDFiumSkiaGoldProperties(skia_gold_properties.SkiaGoldProperties):
14
15  @staticmethod
16  def _GetGitOriginMainHeadSha1():
17    root_finder = pdfium_root.RootDirectoryFinder()
18    try:
19      return subprocess.check_output(['git', 'rev-parse', 'origin/main'],
20                                     shell=_IsWin(),
21                                     cwd=root_finder.pdfium_root).strip()
22    except subprocess.CalledProcessError:
23      return None
24
25
26def _IsWin():
27  return sys.platform == 'win32'
28