| 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_account_mapper.h" | 5 #include "components/gcm_driver/gcm_account_mapper.h" |
| 6 | 6 |
| 7 #include "base/test/simple_test_clock.h" | 7 #include "base/test/simple_test_clock.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "components/gcm_driver/fake_gcm_driver.h" | 9 #include "components/gcm_driver/fake_gcm_driver.h" |
| 10 #include "google_apis/gcm/engine/account_mapping.h" | 10 #include "google_apis/gcm/engine/account_mapping.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 last_action_ = action; | 232 last_action_ = action; |
| 233 last_message_id_ = message_id; | 233 last_message_id_ = message_id; |
| 234 all_messages_[message_id] = action; | 234 all_messages_[message_id] = action; |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace | 237 } // namespace |
| 238 | 238 |
| 239 class GCMAccountMapperTest : public testing::Test { | 239 class GCMAccountMapperTest : public testing::Test { |
| 240 public: | 240 public: |
| 241 GCMAccountMapperTest(); | 241 GCMAccountMapperTest(); |
| 242 virtual ~GCMAccountMapperTest(); | 242 ~GCMAccountMapperTest() override; |
| 243 | 243 |
| 244 void Restart(); | 244 void Restart(); |
| 245 | 245 |
| 246 const GCMAccountMapper::AccountMappings& GetAccounts() const { | 246 const GCMAccountMapper::AccountMappings& GetAccounts() const { |
| 247 return account_mapper_->accounts_; | 247 return account_mapper_->accounts_; |
| 248 } | 248 } |
| 249 | 249 |
| 250 GCMAccountMapper* mapper() { return account_mapper_.get(); } | 250 GCMAccountMapper* mapper() { return account_mapper_.get(); } |
| 251 | 251 |
| 252 CustomFakeGCMDriver& gcm_driver() { return gcm_driver_; } | 252 CustomFakeGCMDriver& gcm_driver() { return gcm_driver_; } |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 expected_mappings[1].status_change_timestamp = clock()->Now(); | 904 expected_mappings[1].status_change_timestamp = clock()->Now(); |
| 905 expected_mappings[1].status = AccountMapping::MAPPED; | 905 expected_mappings[1].status = AccountMapping::MAPPED; |
| 906 expected_mappings[2].status_change_timestamp = clock()->Now(); | 906 expected_mappings[2].status_change_timestamp = clock()->Now(); |
| 907 expected_mappings[2].status = AccountMapping::MAPPED; | 907 expected_mappings[2].status = AccountMapping::MAPPED; |
| 908 | 908 |
| 909 VerifyMappings( | 909 VerifyMappings( |
| 910 expected_mappings, GetAccounts(), "Step 6, Three mapped accounts"); | 910 expected_mappings, GetAccounts(), "Step 6, Three mapped accounts"); |
| 911 } | 911 } |
| 912 | 912 |
| 913 } // namespace gcm | 913 } // namespace gcm |
| OLD | NEW |