#include "extensions/browser/test_extension_console_observer.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/console_message.h"
#include "content/public/test/browser_test_utils.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/service_worker/service_worker_test_utils.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom-shared.h"
namespace extensions {
TestExtensionConsoleObserver::TestExtensionConsoleObserver(
content::BrowserContext* context,
const ExtensionId& extension_id,
bool fail_on_error)
: … { … }
TestExtensionConsoleObserver::~TestExtensionConsoleObserver() = default;
void TestExtensionConsoleObserver::SetAllowedErrorMessages(
base::flat_set<std::u16string> allowed_messages) { … }
std::string TestExtensionConsoleObserver::GetMessageAt(size_t index) { … }
void TestExtensionConsoleObserver::HandleConsoleMessage(
const std::u16string& message,
blink::mojom::ConsoleMessageLevel log_level) { … }
void TestExtensionConsoleObserver::OnReportConsoleMessage(
int64_t version_id,
const GURL& scope,
const content::ConsoleMessage& message) { … }
void TestExtensionConsoleObserver::OnDidAddMessageToConsole(
content::RenderFrameHost* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
const std::u16string& message,
int32_t line_no,
const std::u16string& source_id,
const std::optional<std::u16string>& untrusted_stack_trace) { … }
}