// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "extensions/browser/browsertest_util.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/service_worker_context.h" #include "content/public/browser/storage_partition.h" #include "content/public/test/service_worker_test_helpers.h" #include "extensions/browser/background_script_executor.h" #include "extensions/browser/extension_host.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/process_manager.h" #include "testing/gtest/include/gtest/gtest.h" namespace extensions::browsertest_util { namespace { // Returns a log-friendly script string. std::string GetScriptToLog(const std::string& script) { // The maximum script size for which to print on failure. static constexpr int kMaxFailingScriptSizeToLog = 1000; return (script.size() < kMaxFailingScriptSizeToLog) ? script : "