#include <memory>
#include "services/device/generic_sensor/platform_sensor_provider.h"
#include "base/functional/bind.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/shared_memory_mapping.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "services/device/generic_sensor/fake_platform_sensor_and_provider.h"
#include "services/device/generic_sensor/generic_sensor_consts.h"
#include "services/device/generic_sensor/platform_sensor_util.h"
#include "services/device/public/cpp/generic_sensor/platform_sensor_configuration.h"
#include "services/device/public/cpp/generic_sensor/sensor_reading.h"
#include "services/device/public/cpp/generic_sensor/sensor_reading_shared_buffer.h"
#include "testing/gtest/include/gtest/gtest.h"
TestFuture;
_;
Invoke;
NiceMock;
Return;
namespace device {
SensorType;
namespace {
void AddNewReadingAndExpectNoReadingChangedEvent(
MockPlatformSensorClient* sensor_client,
const SensorReading& new_reading) { … }
void AddNewReadingAndExpectReadingChangedEvent(
MockPlatformSensorClient* sensor_client,
const SensorReading& new_reading) { … }
}
class PlatformSensorAndProviderTest : public testing::Test { … };
TEST_F(PlatformSensorAndProviderTest, ResourcesAreFreed) { … }
TEST_F(PlatformSensorAndProviderTest, ResourcesAreNotFreedOnPendingRequest) { … }
TEST_F(PlatformSensorAndProviderTest, SharedBufferDefaultValue) { … }
TEST_F(PlatformSensorAndProviderTest, SharedBufferCleared) { … }
TEST_F(PlatformSensorAndProviderTest, SensorValueValidityCheckAmbientLight) { … }
TEST_F(PlatformSensorAndProviderTest, ResetLastReadingsOnStop) { … }
TEST_F(PlatformSensorAndProviderTest, DoNotStoreReadingsWhenInactive) { … }
TEST_F(PlatformSensorAndProviderTest, SensorValueValidityCheckPressure) { … }
TEST_F(PlatformSensorAndProviderTest, SensorValueValidityCheckAccelerometer) { … }
TEST_F(PlatformSensorAndProviderTest, IsSignificantlyDifferentAmbientLight) { … }
TEST_F(PlatformSensorAndProviderTest, IsSignificantlyDifferentPressure) { … }
TEST_F(PlatformSensorAndProviderTest, IsSignificantlyDifferentMagnetometer) { … }
}