#include "content/browser/service_worker/service_worker_object_host.h"
#include <tuple>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/default_tick_clock.h"
#include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/fake_embedded_worker_instance_client.h"
#include "content/browser/service_worker/service_worker_client.h"
#include "content/browser/service_worker/service_worker_container_host.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/service_worker/service_worker_registration_object_host.h"
#include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/browser/service_worker/service_worker_version.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration_options.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_state.mojom.h"
#include "url/origin.h"
namespace content {
namespace service_worker_object_host_unittest {
static void SaveStatusCallback(bool* called,
blink::ServiceWorkerStatusCode* out,
blink::ServiceWorkerStatusCode status) { … }
void SetUpDummyMessagePort(std::vector<blink::MessagePortChannel>* ports) { … }
class MessageEventWorker : public FakeServiceWorker { … };
class FailStartInstanceClient : public FakeEmbeddedWorkerInstanceClient { … };
class MockServiceWorkerObject : public blink::mojom::ServiceWorkerObject { … };
class ServiceWorkerObjectHostTest : public testing::Test { … };
TEST_F(ServiceWorkerObjectHostTest, OnVersionStateChanged) { … }
TEST_F(ServiceWorkerObjectHostTest,
DispatchExtendableMessageEvent_FromServiceWorker) { … }
TEST_F(ServiceWorkerObjectHostTest, DispatchExtendableMessageEvent_FromClient) { … }
TEST_F(ServiceWorkerObjectHostTest, OnConnectionError) { … }
TEST_F(ServiceWorkerObjectHostTest,
OnConnectionErrorForRegistrationObjectHost) { … }
}
}