Chromium Code Reviews| 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..2a135381650e69780f920e97305f00c7605060ba 100644 |
| --- a/content/shell/renderer/test_runner/test_runner.cc |
| +++ b/content/shell/renderer/test_runner/test_runner.cc |
| @@ -193,6 +193,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { |
| int max_width, |
| int max_height); |
| bool DisableAutoResizeMode(int new_width, int new_height); |
| + void SetMockDeviceLight(gin::Arguments* args); |
| void SetMockDeviceMotion(gin::Arguments* args); |
| void SetMockDeviceOrientation(gin::Arguments* args); |
| void SetMockScreenOrientation(const std::string& orientation); |
| @@ -395,6 +396,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
| &TestRunnerBindings::EnableAutoResizeMode) |
| .SetMethod("disableAutoResizeMode", |
| &TestRunnerBindings::DisableAutoResizeMode) |
| + .SetMethod("setMockDeviceLight", &TestRunnerBindings::SetMockDeviceLight) |
| .SetMethod("setMockDeviceMotion", |
| &TestRunnerBindings::SetMockDeviceMotion) |
| .SetMethod("setMockDeviceOrientation", |
| @@ -403,8 +405,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
| &TestRunnerBindings::SetMockScreenOrientation) |
| .SetMethod("didChangeBatteryStatus", |
| &TestRunnerBindings::DidChangeBatteryStatus) |
| - .SetMethod("resetBatteryStatus", |
| - &TestRunnerBindings::ResetBatteryStatus) |
| + .SetMethod("resetBatteryStatus", &TestRunnerBindings::ResetBatteryStatus) |
|
jochen (gone - plz use gerrit)
2014/06/26 14:59:14
unrelated to your change?
riju_
2014/06/28 00:20:07
Yes, unrelated, but i ran git cl format, and that
|
| .SetMethod("didAcquirePointerLock", |
| &TestRunnerBindings::DidAcquirePointerLock) |
| .SetMethod("didNotAcquirePointerLock", |
| @@ -502,8 +503,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
| &TestRunnerBindings::PathToLocalResource) |
| .SetMethod("setBackingScaleFactor", |
| &TestRunnerBindings::SetBackingScaleFactor) |
| - .SetMethod("setColorProfile", |
| - &TestRunnerBindings::SetColorProfile) |
| + .SetMethod("setColorProfile", &TestRunnerBindings::SetColorProfile) |
| .SetMethod("setPOSIXLocale", &TestRunnerBindings::SetPOSIXLocale) |
| .SetMethod("setMIDIAccessorResult", |
| &TestRunnerBindings::SetMIDIAccessorResult) |
| @@ -524,7 +524,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
| &TestRunnerBindings::RemoveWebPageOverlay) |
| .SetMethod("displayAsync", &TestRunnerBindings::DisplayAsync) |
| .SetMethod("displayAsyncThen", &TestRunnerBindings::DisplayAsyncThen) |
| - .SetMethod("capturePixelsAsyncThen", &TestRunnerBindings::CapturePixelsAsyncThen) |
| + .SetMethod("capturePixelsAsyncThen", |
| + &TestRunnerBindings::CapturePixelsAsyncThen) |
| .SetMethod("setCustomTextOutput", |
| &TestRunnerBindings::SetCustomTextOutput) |
| .SetMethod("setViewSourceForFrame", |
| @@ -822,6 +823,14 @@ bool TestRunnerBindings::DisableAutoResizeMode(int new_width, int new_height) { |
| return false; |
| } |
| +void TestRunnerBindings::SetMockDeviceLight(gin::Arguments* args) { |
|
jochen (gone - plz use gerrit)
2014/06/26 14:59:14
just use double as argument, then gin will do the
riju_
2014/06/28 00:20:07
Done.
|
| + if (!runner_) |
| + return; |
| + double value; |
| + args->GetNext(&value); |
| + runner_->SetMockDeviceLight(value); |
| +} |
| + |
| void TestRunnerBindings::SetMockDeviceMotion(gin::Arguments* args) { |
| if (!runner_) |
| return; |
| @@ -2270,6 +2279,10 @@ bool TestRunner::DisableAutoResizeMode(int new_width, int new_height) { |
| return true; |
| } |
| +void TestRunner::SetMockDeviceLight(double value) { |
| + delegate_->setDeviceLightData(value); |
| +} |
| + |
| void TestRunner::SetMockDeviceMotion( |
| bool has_acceleration_x, double acceleration_x, |
| bool has_acceleration_y, double acceleration_y, |