OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/gcm_driver/gcm_driver_desktop.h" | 5 #include "components/gcm_driver/gcm_driver_desktop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 const char kTestAccountID1[] = "user1@example.com"; | 40 const char kTestAccountID1[] = "user1@example.com"; |
41 const char kTestAccountID2[] = "user2@example.com"; | 41 const char kTestAccountID2[] = "user2@example.com"; |
42 const char kTestAppID1[] = "TestApp1"; | 42 const char kTestAppID1[] = "TestApp1"; |
43 const char kTestAppID2[] = "TestApp2"; | 43 const char kTestAppID2[] = "TestApp2"; |
44 const char kUserID1[] = "user1"; | 44 const char kUserID1[] = "user1"; |
45 | 45 |
46 class FakeGCMConnectionObserver : public GCMConnectionObserver { | 46 class FakeGCMConnectionObserver : public GCMConnectionObserver { |
47 public: | 47 public: |
48 FakeGCMConnectionObserver(); | 48 FakeGCMConnectionObserver(); |
49 virtual ~FakeGCMConnectionObserver(); | 49 ~FakeGCMConnectionObserver() override; |
50 | 50 |
51 // gcm::GCMConnectionObserver implementation: | 51 // gcm::GCMConnectionObserver implementation: |
52 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) override; | 52 void OnConnected(const net::IPEndPoint& ip_endpoint) override; |
53 virtual void OnDisconnected() override; | 53 void OnDisconnected() override; |
54 | 54 |
55 bool connected() const { return connected_; } | 55 bool connected() const { return connected_; } |
56 | 56 |
57 private: | 57 private: |
58 bool connected_; | 58 bool connected_; |
59 }; | 59 }; |
60 | 60 |
61 FakeGCMConnectionObserver::FakeGCMConnectionObserver() : connected_(false) { | 61 FakeGCMConnectionObserver::FakeGCMConnectionObserver() : connected_(false) { |
62 } | 62 } |
63 | 63 |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 // After start-up, the request should still be scheduled at the expected | 1238 // After start-up, the request should still be scheduled at the expected |
1239 // updated interval. | 1239 // updated interval. |
1240 actual_delay_seconds = | 1240 actual_delay_seconds = |
1241 syncer()->current_request_delay_interval().InSeconds(); | 1241 syncer()->current_request_delay_interval().InSeconds(); |
1242 EXPECT_TRUE(CompareDelaySeconds(expected_delay_seconds, actual_delay_seconds)) | 1242 EXPECT_TRUE(CompareDelaySeconds(expected_delay_seconds, actual_delay_seconds)) |
1243 << "expected delay: " << expected_delay_seconds | 1243 << "expected delay: " << expected_delay_seconds |
1244 << " actual delay: " << actual_delay_seconds; | 1244 << " actual delay: " << actual_delay_seconds; |
1245 } | 1245 } |
1246 | 1246 |
1247 } // namespace gcm | 1247 } // namespace gcm |
OLD | NEW |