| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/sync_sessions/lost_navigations_recorder.h" | 5 #include "components/sync_sessions/lost_navigations_recorder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/test/histogram_tester.h" | 11 #include "base/test/histogram_tester.h" |
| 12 #include "components/sync/model/attachments/attachment_service_proxy_for_test.h" | 12 #include "components/sync/model/attachments/attachment_service_proxy_for_test.h" |
| 13 #include "components/sync/syncable/entry.h" | 13 #include "components/sync/syncable/entry.h" |
| 14 #include "components/sync/syncable/mutable_entry.h" | 14 #include "components/sync/syncable/mutable_entry.h" |
| 15 #include "components/sync/syncable/syncable_base_transaction.h" | 15 #include "components/sync/syncable/syncable_base_transaction.h" |
| 16 #include "components/sync/syncable/syncable_read_transaction.h" | 16 #include "components/sync/syncable/syncable_read_transaction.h" |
| 17 #include "components/sync/syncable/syncable_write_transaction.h" | 17 #include "components/sync/syncable/syncable_write_transaction.h" |
| 18 #include "components/sync/test/engine/test_directory_setter_upper.h" | 18 #include "components/sync/test/engine/test_directory_setter_upper.h" |
| 19 #include "components/sync/test/engine/test_id_factory.h" | 19 #include "components/sync/test/engine/test_id_factory.h" |
| 20 #include "components/sync_sessions/sessions_sync_manager.h" | 20 #include "components/sync_sessions/sessions_sync_manager.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 22 |
| 23 using syncer::syncable::Entry; | 23 using syncer::syncable::Entry; |
| 24 using syncer::syncable::Id; | 24 using syncer::syncable::Id; |
| 25 using syncer::syncable::MutableEntry; | 25 using syncer::syncable::MutableEntry; |
| 26 using syncer::syncable::WriteTransaction; | 26 using syncer::syncable::WriteTransaction; |
| 27 | 27 |
| 28 namespace sync_sessions { | 28 namespace sync_sessions { |
| 29 namespace { | 29 namespace { |
| 30 typedef SessionID::id_type id_type; | 30 using id_type = SessionID::id_type; |
| 31 | 31 |
| 32 const char kTab1SyncTag[] = "tab-YWRkcjHvv74="; | 32 const char kTab1SyncTag[] = "tab-YWRkcjHvv74="; |
| 33 const char kTab2SyncTag[] = "tab-2FyZDHvv74="; | 33 const char kTab2SyncTag[] = "tab-2FyZDHvv74="; |
| 34 | 34 |
| 35 class LostNavigationsRecorderTest : public testing::Test { | 35 class LostNavigationsRecorderTest : public testing::Test { |
| 36 protected: | 36 protected: |
| 37 void SetUp() override { | 37 void SetUp() override { |
| 38 dir_maker_.SetUp(); | 38 dir_maker_.SetUp(); |
| 39 _id = 1; | 39 _id = 1; |
| 40 } | 40 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 ->DeleteSubrange(0, 2); | 390 ->DeleteSubrange(0, 2); |
| 391 RecordChange(&mutable_entry, specifics); | 391 RecordChange(&mutable_entry, specifics); |
| 392 | 392 |
| 393 TriggerReconcile(&mutable_entry, true, &specifics); | 393 TriggerReconcile(&mutable_entry, true, &specifics); |
| 394 | 394 |
| 395 histogram_tester.ExpectBucketCount("Sync.LostNavigationCount", 2, 1); | 395 histogram_tester.ExpectBucketCount("Sync.LostNavigationCount", 2, 1); |
| 396 } | 396 } |
| 397 | 397 |
| 398 }; // namespace | 398 }; // namespace |
| 399 }; // namespace sync_sessions | 399 }; // namespace sync_sessions |
| OLD | NEW |