diff options
author | Vitaly Buka <vitalybuka@google.com> | 2015-12-12 15:51:51 -0800 |
---|---|---|
committer | Alex Vakulenko <avakulenko@google.com> | 2015-12-14 17:11:22 +0000 |
commit | b03d4ddd8eb3475684cf327bb5a3812e3f45dc79 (patch) | |
tree | 23a46ccca82d7734de1b980b195e8ae3c7fd4347 /src/privet | |
parent | 1884cf644b9a48119438a17864509176dd47c646 (diff) | |
download | libweave-b03d4ddd8eb3475684cf327bb5a3812e3f45dc79.tar.gz |
Remove /privet/info:uptime as unused
BUG=26170260
Change-Id: I8cc5d159b1d94751610c98cfa8e1067b97431b73
Reviewed-on: https://weave-review.googlesource.com/1926
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
Diffstat (limited to 'src/privet')
-rw-r--r-- | src/privet/device_delegate.cc | 5 | ||||
-rw-r--r-- | src/privet/device_delegate.h | 3 | ||||
-rw-r--r-- | src/privet/mock_delegates.h | 3 | ||||
-rw-r--r-- | src/privet/privet_handler.cc | 2 | ||||
-rw-r--r-- | src/privet/privet_handler_unittest.cc | 2 |
5 files changed, 0 insertions, 15 deletions
diff --git a/src/privet/device_delegate.cc b/src/privet/device_delegate.cc index 9a05483..5722357 100644 --- a/src/privet/device_delegate.cc +++ b/src/privet/device_delegate.cc @@ -30,10 +30,6 @@ class DeviceDelegateImpl : public DeviceDelegate { std::pair<uint16_t, uint16_t> GetHttpsEnpoint() const override { return std::make_pair(https_port_, https_port_); } - base::TimeDelta GetUptime() const override { - return base::Time::Now() - start_time_; - } - base::TimeDelta GetHttpRequestTimeout() const override { return http_request_timeout_; } @@ -49,7 +45,6 @@ class DeviceDelegateImpl : public DeviceDelegate { base::TimeDelta http_request_timeout_; uint16_t http_port_{0}; uint16_t https_port_{0}; - base::Time start_time_{base::Time::Now()}; }; } // namespace diff --git a/src/privet/device_delegate.h b/src/privet/device_delegate.h index 1affa1b..9d9b186 100644 --- a/src/privet/device_delegate.h +++ b/src/privet/device_delegate.h @@ -35,9 +35,6 @@ class DeviceDelegate { // The same |GetHttpEnpoint| but for HTTPS. virtual std::pair<uint16_t, uint16_t> GetHttpsEnpoint() const = 0; - // Returns device uptime. - virtual base::TimeDelta GetUptime() const = 0; - // Returns the max request timeout of http server. Returns TimeDelta::Max() if // no timeout is set. virtual base::TimeDelta GetHttpRequestTimeout() const = 0; diff --git a/src/privet/mock_delegates.h b/src/privet/mock_delegates.h index 5c003a7..b661809 100644 --- a/src/privet/mock_delegates.h +++ b/src/privet/mock_delegates.h @@ -44,7 +44,6 @@ class MockDeviceDelegate : public DeviceDelegate { public: MOCK_CONST_METHOD0(GetHttpEnpoint, IntPair()); MOCK_CONST_METHOD0(GetHttpsEnpoint, IntPair()); - MOCK_CONST_METHOD0(GetUptime, base::TimeDelta()); MOCK_CONST_METHOD0(GetHttpRequestTimeout, base::TimeDelta()); MOCK_METHOD3(PostDelayedTask, void(const tracked_objects::Location&, const base::Closure&, @@ -55,8 +54,6 @@ class MockDeviceDelegate : public DeviceDelegate { .WillRepeatedly(Return(std::make_pair(0, 0))); EXPECT_CALL(*this, GetHttpsEnpoint()) .WillRepeatedly(Return(std::make_pair(0, 0))); - EXPECT_CALL(*this, GetUptime()) - .WillRepeatedly(Return(base::TimeDelta::FromHours(1))); } }; diff --git a/src/privet/privet_handler.cc b/src/privet/privet_handler.cc index df0c74d..ab4eece 100644 --- a/src/privet/privet_handler.cc +++ b/src/privet/privet_handler.cc @@ -69,7 +69,6 @@ const char kInfoWifiCapabilitiesKey[] = "capabilities"; const char kInfoWifiSsidKey[] = "ssid"; const char kInfoWifiHostedSsidKey[] = "hostedSsid"; -const char kInfoUptimeKey[] = "uptime"; const char kInfoTimeKey[] = "time"; const char kPairingKey[] = "pairing"; @@ -547,7 +546,6 @@ void PrivetHandler::HandleInfo(const base::DictionaryValue&, output.Set(kGcdKey, CreateGcdSection(*cloud_).release()); - output.SetInteger(kInfoUptimeKey, device_->GetUptime().InSeconds()); output.SetDouble(kInfoTimeKey, clock_->Now().ToJsTime()); callback.Run(http::kOk, output); diff --git a/src/privet/privet_handler_unittest.cc b/src/privet/privet_handler_unittest.cc index 3f8f975..12182d9 100644 --- a/src/privet/privet_handler_unittest.cc +++ b/src/privet/privet_handler_unittest.cc @@ -247,7 +247,6 @@ TEST_F(PrivetHandlerTest, InfoMinimal) { 'id': '', 'status': 'disabled' }, - 'uptime': 3600, 'time': 1410000001000.0 })"; EXPECT_JSON_EQ(kExpected, HandleRequest("/privet/info", "{}")); @@ -309,7 +308,6 @@ TEST_F(PrivetHandlerTest, Info) { 'id': 'TestCloudId', 'status': 'online' }, - 'uptime': 3600, 'time': 1410000001000.0 })"; EXPECT_JSON_EQ(kExpected, HandleRequest("/privet/info", "{}")); |