chromium/chrome/browser/extensions/test_resources_browsertest.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <optional>

#include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/externally_connectable.h"
#include "extensions/common/url_pattern.h"
#include "extensions/test/test_extension_dir.h"

namespace extensions {

namespace {

constexpr char kComponentExtensionKey[] =;

// The value set by the script
// in chrome/test/data/extensions/test_resources_test/script.js.
constexpr int kSentinelValue =;

// Returns the value of window.injectedSentinel from the active web contents of
// |browser|.
int RetrieveSentinelValue(Browser* browser) {}

class ExtensionBrowserTestWithCustomTestResourcesLocation
    : public ExtensionBrowserTest {};

}  // namespace

// A simple test to ensure resources can be served from _test_resources/, and
// properly load.
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TestResourcesLoad) {}

// Tests that resources from _test_resources work in component extensions
// (which have a slightly different load path).
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest,
                       TestResourcesLoadInComponentExtension) {}

IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest,
                       LoadComponentExtensionUpdateWithManifestChanges) {}

// Tests that resources from _test_resources can be loaded from different
// directories. Though the default is chrome/test/data/extensions, a test class
// can specify its own.
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTestWithCustomTestResourcesLocation,
                       TestResourcesLoadFromCustomPath) {}

}  // namespace extensions