#include "chrome/browser/serial/serial_policy_allowed_ports.h"
#include "base/containers/contains.h"
#include "base/test/values_test_util.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/testing_pref_service.h"
#include "content/public/test/browser_task_environment.h"
#include "services/device/public/mojom/serial.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace {
ParseJson;
UnorderedElementsAre;
device::mojom::SerialPortInfoPtr CreateUsbDevice(uint16_t vendor_id,
uint16_t product_id) { … }
device::mojom::SerialPortInfoPtr CreatePlatformPort() { … }
}
class SerialPolicyAllowedPortsTest : public testing::Test { … };
TEST_F(SerialPolicyAllowedPortsTest, InitializeWithMissingPrefValue) { … }
TEST_F(SerialPolicyAllowedPortsTest, InitializeWithEmptyPrefValues) { … }
TEST_F(SerialPolicyAllowedPortsTest, InitializeWithPrefValues) { … }
TEST_F(SerialPolicyAllowedPortsTest,
InitializeWithMissingPrefValuesThenUpdate) { … }
TEST_F(SerialPolicyAllowedPortsTest, InitializeWithPrefValuesThenRemovePolicy) { … }
TEST_F(SerialPolicyAllowedPortsTest, MultipleItemsWithOverlap) { … }