Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: device/vibration/vibration_manager_impl_default.cc

Issue 2774783003: [DeviceService] Add service tests for VibrationManager. (Closed)
Patch Set: Let service_test app itself register mojo JNIs Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/vibration/vibration_manager_impl_default.cc
diff --git a/device/vibration/vibration_manager_impl_default.cc b/device/vibration/vibration_manager_impl_default.cc
index 642ddbb75161cf868ff32f51c6a18561b22d5c3e..c073f69a1f0fecfc80974aee551ff36af7cf822d 100644
--- a/device/vibration/vibration_manager_impl_default.cc
+++ b/device/vibration/vibration_manager_impl_default.cc
@@ -11,6 +11,9 @@
namespace device {
+int64_t VibrationManagerImpl::milli_seconds_for_testing_ = -1;
+bool VibrationManagerImpl::cancelled_for_testing_ = false;
+
namespace {
class VibrationManagerEmptyImpl : public mojom::VibrationManager {
@@ -19,10 +22,14 @@ class VibrationManagerEmptyImpl : public mojom::VibrationManager {
~VibrationManagerEmptyImpl() override {}
void Vibrate(int64_t milliseconds, const VibrateCallback& callback) override {
+ VibrationManagerImpl::milli_seconds_for_testing_ = milliseconds;
callback.Run();
}
- void Cancel(const CancelCallback& callback) override { callback.Run(); }
+ void Cancel(const CancelCallback& callback) override {
+ VibrationManagerImpl::cancelled_for_testing_ = true;
+ callback.Run();
+ }
};
} // namespace

Powered by Google App Engine
This is Rietveld 408576698