Switch to main branch in test tools and documentation.

The main branch is now available in PDFium, so use that wherever
possible.

Change-Id: I349777aa2401f58624c70954b3c343d02f43c933
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/82771
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4c20a5d..b14a45a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,7 +3,7 @@
 [Chromium Contributing](https://chromium.googlesource.com/chromium/src/+/main/docs/contributing.md)
 guidelines in PDFium. The code review process, and the build tools are all very
 similar to Chromium. The PDFium
-[README](https://pdfium.googlesource.com/pdfium/+/refs/heads/master/README.md)
+[README](https://pdfium.googlesource.com/pdfium/+/refs/heads/main/README.md)
 outlines specific build and test information for PDFium.
 
 This document focuses on how the PDFium project operates and how we’d like it
@@ -56,7 +56,7 @@
 There are a lot of consumers of PDFium outside of Chromium. These include
 LibreOffice, Android and offline conversion tooling. As such, a lot of care is
 taken around the code in the
-[public](https://pdfium.googlesource.com/pdfium/+/refs/heads/master/public/)
+[public](https://pdfium.googlesource.com/pdfium/+/refs/heads/main/public/)
 folder. When planning on changing the public API, the change should be preceded
 by a bug being created and an email to the mailing list to gather feedback from
 other PDFium embedders.
@@ -161,7 +161,7 @@
 and send it to us as described on that page.
 
 Your first CL should add yourself to the
-[AUTHORS](https://pdfium.googlesource.com/pdfium/+/refs/heads/master/AUTHORS)
+[AUTHORS](https://pdfium.googlesource.com/pdfium/+/refs/heads/main/AUTHORS)
 file (unless you’re covered by one of the blanket entries).
 
 ### External contributor checklist for reviewers
@@ -170,7 +170,7 @@
    request on
    [https://pdfium-review.googlesource.com](https://pdfium-review.googlesource.com/)
  * Ensure the author is already listed in
-   [AUTHORS](https://pdfium.googlesource.com/pdfium/+/refs/heads/master/AUTHORS).
+   [AUTHORS](https://pdfium.googlesource.com/pdfium/+/refs/heads/main/AUTHORS).
    In some cases, the author's company might have a wildcard rule
    (e.g. \*@google.com).
  * If the author or their company is not listed, the CL should include a new
diff --git a/README.md b/README.md
index b6a0396..286bda8 100644
--- a/README.md
+++ b/README.md
@@ -167,7 +167,7 @@
 This saves space and also allows an easy way to reduce the test case to the
 essentials as you can simply remove everything that is not necessary.
 
-A simple example can be found [here](https://pdfium.googlesource.com/pdfium/+/refs/heads/master/testing/resources/rectangles.in).
+A simple example can be found [here](https://pdfium.googlesource.com/pdfium/+/refs/heads/main/testing/resources/rectangles.in).
 
 To transform this into a PDF, you can use the `fixup_pdf_template.py` tool:
 
diff --git a/docs/getting-started.md b/docs/getting-started.md
index e5b261b..6470f8a 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -182,6 +182,6 @@
 
 
 [chrome-plugin]: https://chromium.googlesource.com/chromium/src/+/main/pdf/
-[pdfium-public]: https://pdfium.googlesource.com/pdfium/+/master/public/
+[pdfium-public]: https://pdfium.googlesource.com/pdfium/+/main/public/
 [pdfium-v8]: /docs/v8-getting-started.md
 [pdfium-edit-guide]: /docs/pdfium-edit-guide.md
diff --git a/testing/tools/githelper.py b/testing/tools/githelper.py
index 91a6c71..4637ed7 100644
--- a/testing/tools/githelper.py
+++ b/testing/tools/githelper.py
@@ -20,8 +20,8 @@
     RunCommandPropagateErr(['git', 'checkout', branch], exit_status_on_error=1)
 
   def FetchOriginMaster(self):
-    """Fetches new changes on origin/master."""
-    RunCommandPropagateErr(['git', 'fetch', 'origin', 'master'],
+    """Fetches new changes on origin/main."""
+    RunCommandPropagateErr(['git', 'fetch', 'origin', 'main'],
                            exit_status_on_error=1)
 
   def StashPush(self):
diff --git a/testing/tools/safetynet_job.py b/testing/tools/safetynet_job.py
index 9b5cbfd..c1361c1 100755
--- a/testing/tools/safetynet_job.py
+++ b/testing/tools/safetynet_job.py
@@ -69,7 +69,7 @@
 
     if not self.args.no_checkout:
       self.git.FetchOriginMaster()
-      self.git.Checkout('origin/master')
+      self.git.Checkout('origin/main')
 
     # Make sure results dir exists
     if not os.path.exists(self.context.results_dir):
@@ -200,7 +200,7 @@
   parser.add_argument(
       '--no-checkout',
       action='store_true',
-      help='whether to skip checking out origin/master. Use '
+      help='whether to skip checking out origin/main. Use '
       'for script debugging.')
   parser.add_argument(
       '--no-checkpoint',
diff --git a/testing/tools/skia_gold/pdfium_skia_gold_properties.py b/testing/tools/skia_gold/pdfium_skia_gold_properties.py
index 525b212..bf1e924 100644
--- a/testing/tools/skia_gold/pdfium_skia_gold_properties.py
+++ b/testing/tools/skia_gold/pdfium_skia_gold_properties.py
@@ -16,7 +16,7 @@
   @staticmethod
   def _GetGitOriginMasterHeadSha1():
     try:
-      return subprocess.check_output(['git', 'rev-parse', 'origin/master'],
+      return subprocess.check_output(['git', 'rev-parse', 'origin/main'],
                                      shell=_IsWin(),
                                      cwd=path_util.GetPDFiumDir()).strip()
     except subprocess.CalledProcessError: