• Devlin Cronin's avatar
    [Extensions] Beef up _test_resources handling · d5d4adaf
    Devlin Cronin authored
    ExtensionBrowserTests look for paths beginning with "_test_resources" in
    extension resources being loaded, and redirect them. The original
    motivation for this was to allow us to re-use common utility files
    between loaded test extensions.
    
    We want to use this in the PDF extension tests. For this, we want to
    load resources that aren't part of the extension itself as if they
    were - specifically, for the sake of exercising module code.
    
    Beef up the _test_resources handling by:
    - adding support for subclasses to specify their own parent directory
      through ExtensionBrowserTest::GetTestResourcesParentDir(). This allows
      PDF tests to load resources from chrome/test/data/pdf instead of
      chrome/test/data/extensions.
    - adding browser test coverage, including the basic case, a component
      extension case (which the PDF extension is), and the customized
      resource parent.
    
    This is needed to unblock the PDF extension's use of modules, which in
    turn is needed for the Polymer 2 -> Polymer 3 migration.
    
    Bug: 1005029
    Change-Id: I8a998eebf38bb680ffde72f512b962d83fe75989
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850779
    Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
    Reviewed-by: default avatarKelvin Jiang <kelvinjiang@chromium.org>
    Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#706055}
    d5d4adaf
BUILD.gn 333 KB