chromium/content/browser/serial/serial_unittest.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 "base/barrier_closure.h"
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/repeating_test_future.h"
#include "base/test/test_future.h"
#include "content/browser/serial/serial_test_utils.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/navigation_simulator.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "device/bluetooth/public/cpp/bluetooth_uuid.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/test_support/fake_message_dispatch_context.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "services/device/public/cpp/test/fake_serial_port_client.h"
#include "services/device/public/cpp/test/fake_serial_port_manager.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/serial/serial.mojom-blink.h"
#include "url/origin.h"

namespace content {

namespace {

InvokeFuture;
TestFuture;
_;
Invoke;
Return;

const char kTestUrl[] =;
const char kCrossOriginTestUrl[] =;

class MockSerialServiceClient : public blink::mojom::SerialServiceClient {};

class SerialTest : public RenderViewHostImplTestHarness {};

}  // namespace

TEST_F(SerialTest, GetPortsForAllDeviceTypes) {}

TEST_F(SerialTest, OpenAndClosePort) {}

TEST_F(SerialTest, OpenWithoutPermission) {}

TEST_F(SerialTest, OpenFailure) {}

TEST_F(SerialTest, OpenAndNavigateCrossOrigin) {}

TEST_F(SerialTest, SameBluetoothSerialPortSameToken) {}

TEST_F(SerialTest, AddAndRemovePorts) {}

TEST_F(SerialTest, PortConnectedState) {}

TEST_F(SerialTest, OpenAndClosePortManagerConnection) {}

TEST_F(SerialTest, OpenAndRevokePermission) {}

TEST_F(SerialTest, OpenAndRevokePermissionOnDifferentOrigin) {}

TEST_F(SerialTest, OpenTwoPortsAndRevokePermission) {}

TEST_F(SerialTest, RejectOpaqueOrigin) {}

TEST_F(SerialTest, RejectOpaqueOriginEmbeddedFrame) {}

}  // namespace content