| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
| 6 #include "chrome/browser/sync/test/integration/dictionary_helper.h" | 6 #include "chrome/browser/sync/test/integration/dictionary_helper.h" |
| 7 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| 8 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | 8 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
| 9 #include "chrome/browser/sync/test/integration/sync_test.h" | 9 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 10 #include "chrome/common/spellcheck_common.h" | 10 #include "chrome/common/spellcheck_common.h" |
| 11 | 11 |
| 12 using sync_integration_test_util::AwaitCommitActivityCompletion; | 12 using sync_integration_test_util::AwaitCommitActivityCompletion; |
| 13 | 13 |
| 14 class TwoClientDictionarySyncTest : public SyncTest { | 14 class TwoClientDictionarySyncTest : public SyncTest { |
| 15 public: | 15 public: |
| 16 TwoClientDictionarySyncTest() : SyncTest(TWO_CLIENT) {} | 16 TwoClientDictionarySyncTest() : SyncTest(TWO_CLIENT) {} |
| 17 virtual ~TwoClientDictionarySyncTest() {} | 17 ~TwoClientDictionarySyncTest() override {} |
| 18 | 18 |
| 19 virtual bool TestUsesSelfNotifications() override { | 19 bool TestUsesSelfNotifications() override { return false; } |
| 20 return false; | |
| 21 } | |
| 22 | 20 |
| 23 private: | 21 private: |
| 24 DISALLOW_COPY_AND_ASSIGN(TwoClientDictionarySyncTest); | 22 DISALLOW_COPY_AND_ASSIGN(TwoClientDictionarySyncTest); |
| 25 }; | 23 }; |
| 26 | 24 |
| 27 IN_PROC_BROWSER_TEST_F(TwoClientDictionarySyncTest, Sanity) { | 25 IN_PROC_BROWSER_TEST_F(TwoClientDictionarySyncTest, Sanity) { |
| 28 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 26 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 29 dictionary_helper::LoadDictionaries(); | 27 dictionary_helper::LoadDictionaries(); |
| 30 ASSERT_TRUE(dictionary_helper::AwaitDictionariesMatch()); | 28 ASSERT_TRUE(dictionary_helper::AwaitDictionariesMatch()); |
| 31 | 29 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 ASSERT_TRUE(dictionary_helper::AwaitDictionariesMatch()); | 89 ASSERT_TRUE(dictionary_helper::AwaitDictionariesMatch()); |
| 92 // Remove on client A, check it disappears on B. | 90 // Remove on client A, check it disappears on B. |
| 93 ASSERT_TRUE(dictionary_helper::RemoveWord(0, word)); | 91 ASSERT_TRUE(dictionary_helper::RemoveWord(0, word)); |
| 94 ASSERT_TRUE(dictionary_helper::AwaitDictionariesMatch()); | 92 ASSERT_TRUE(dictionary_helper::AwaitDictionariesMatch()); |
| 95 // Add on client B, check it appears on A. | 93 // Add on client B, check it appears on A. |
| 96 ASSERT_TRUE(dictionary_helper::AddWord(1, word)); | 94 ASSERT_TRUE(dictionary_helper::AddWord(1, word)); |
| 97 ASSERT_TRUE(dictionary_helper::AwaitDictionariesMatch()); | 95 ASSERT_TRUE(dictionary_helper::AwaitDictionariesMatch()); |
| 98 ASSERT_EQ(1UL, dictionary_helper::GetDictionarySize(0)); | 96 ASSERT_EQ(1UL, dictionary_helper::GetDictionarySize(0)); |
| 99 } | 97 } |
| 100 | 98 |
| OLD | NEW |