| Index: content/shell/renderer/test_runner/test_runner.cc
|
| diff --git a/content/shell/renderer/test_runner/test_runner.cc b/content/shell/renderer/test_runner/test_runner.cc
|
| index 3a505457eec72804d13255fce551a2050839a07a..c0803a86c9adcf6411ed6f89df12b9f6c1cc06ec 100644
|
| --- a/content/shell/renderer/test_runner/test_runner.cc
|
| +++ b/content/shell/renderer/test_runner/test_runner.cc
|
| @@ -193,6 +193,8 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
|
| int max_width,
|
| int max_height);
|
| bool DisableAutoResizeMode(int new_width, int new_height);
|
| + void SetMockDeviceLight(double value);
|
| + void ResetDeviceLight();
|
| void SetMockDeviceMotion(gin::Arguments* args);
|
| void SetMockDeviceOrientation(gin::Arguments* args);
|
| void SetMockScreenOrientation(const std::string& orientation);
|
| @@ -395,6 +397,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
|
| &TestRunnerBindings::EnableAutoResizeMode)
|
| .SetMethod("disableAutoResizeMode",
|
| &TestRunnerBindings::DisableAutoResizeMode)
|
| + .SetMethod("setMockDeviceLight", &TestRunnerBindings::SetMockDeviceLight)
|
| + .SetMethod("resetDeviceLight", &TestRunnerBindings::ResetDeviceLight)
|
| .SetMethod("setMockDeviceMotion",
|
| &TestRunnerBindings::SetMockDeviceMotion)
|
| .SetMethod("setMockDeviceOrientation",
|
| @@ -822,6 +826,17 @@ bool TestRunnerBindings::DisableAutoResizeMode(int new_width, int new_height) {
|
| return false;
|
| }
|
|
|
| +void TestRunnerBindings::SetMockDeviceLight(double value) {
|
| + if (!runner_)
|
| + return;
|
| + runner_->SetMockDeviceLight(value);
|
| +}
|
| +
|
| +void TestRunnerBindings::ResetDeviceLight() {
|
| + if (runner_)
|
| + runner_->ResetDeviceLight();
|
| +}
|
| +
|
| void TestRunnerBindings::SetMockDeviceMotion(gin::Arguments* args) {
|
| if (!runner_)
|
| return;
|
| @@ -1565,6 +1580,7 @@ void TestRunner::Reset() {
|
| delegate_->deleteAllCookies();
|
| delegate_->resetScreenOrientation();
|
| ResetBatteryStatus();
|
| + ResetDeviceLight();
|
| }
|
|
|
| dump_editting_callbacks_ = false;
|
| @@ -2270,6 +2286,14 @@ bool TestRunner::DisableAutoResizeMode(int new_width, int new_height) {
|
| return true;
|
| }
|
|
|
| +void TestRunner::SetMockDeviceLight(double value) {
|
| + delegate_->setDeviceLightData(value);
|
| +}
|
| +
|
| +void TestRunner::ResetDeviceLight() {
|
| + delegate_->setDeviceLightData(-1);
|
| +}
|
| +
|
| void TestRunner::SetMockDeviceMotion(
|
| bool has_acceleration_x, double acceleration_x,
|
| bool has_acceleration_y, double acceleration_y,
|
|
|