#include "third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump.h"
#include <string.h>
#include <memory>
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "services/device/public/cpp/test/fake_sensor_and_provider.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/platform_event_controller.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/modules/device_orientation/device_orientation_data.h"
#include "third_party/blink/renderer/modules/device_orientation/device_sensor_entry.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
namespace {
constexpr double kEpsilon = …;
}
namespace blink {
FakeSensorProvider;
SensorType;
State;
class MockDeviceOrientationController final
: public GarbageCollected<MockDeviceOrientationController>,
public PlatformEventController { … };
class DeviceOrientationEventPumpTest : public testing::Test { … };
TEST_F(DeviceOrientationEventPumpTest, SensorIsActive) { … }
TEST_F(DeviceOrientationEventPumpTest, SensorSuspendedDuringInitialization) { … }
TEST_F(DeviceOrientationEventPumpTest, SensorIsActiveWithSensorFallback) { … }
TEST_F(DeviceOrientationEventPumpTest, SensorSuspendedDuringFallback) { … }
TEST_F(DeviceOrientationEventPumpTest, SomeSensorDataFieldsNotAvailable) { … }
TEST_F(DeviceOrientationEventPumpTest,
SomeSensorDataFieldsNotAvailableWithSensorFallback) { … }
TEST_F(DeviceOrientationEventPumpTest, FireAllNullEvent) { … }
TEST_F(DeviceOrientationEventPumpTest,
NotFireEventWhenSensorReadingTimeStampIsZero) { … }
TEST_F(DeviceOrientationEventPumpTest,
NotFireEventWhenSensorReadingTimeStampIsZeroWithSensorFallback) { … }
TEST_F(DeviceOrientationEventPumpTest, UpdateRespectsOrientationThreshold) { … }
TEST_F(DeviceOrientationEventPumpTest,
UpdateRespectsOrientationThresholdWithSensorFallback) { … }
class DeviceAbsoluteOrientationEventPumpTest : public testing::Test { … };
TEST_F(DeviceAbsoluteOrientationEventPumpTest, SensorIsActive) { … }
TEST_F(DeviceAbsoluteOrientationEventPumpTest,
SomeSensorDataFieldsNotAvailable) { … }
TEST_F(DeviceAbsoluteOrientationEventPumpTest, FireAllNullEvent) { … }
TEST_F(DeviceAbsoluteOrientationEventPumpTest,
NotFireEventWhenSensorReadingTimeStampIsZero) { … }
TEST_F(DeviceAbsoluteOrientationEventPumpTest,
UpdateRespectsOrientationThreshold) { … }
}