| 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/string_number_conversions.h" | 5 #include "base/string_number_conversions.h" |
| 6 #include "chrome/browser/sync/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 7 #include "chrome/browser/sync/test/integration/dictionary_helper.h" | 7 #include "chrome/browser/sync/test/integration/dictionary_helper.h" |
| 8 #include "chrome/browser/sync/test/integration/sync_test.h" | 8 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 9 #include "chrome/common/spellcheck_common.h" | 9 #include "chrome/common/spellcheck_common.h" |
| 10 | 10 |
| 11 class TwoClientDictionarySyncTest : public SyncTest { | 11 class TwoClientDictionarySyncTest : public SyncTest { |
| 12 public: | 12 public: |
| 13 TwoClientDictionarySyncTest() : SyncTest(TWO_CLIENT) {} | 13 TwoClientDictionarySyncTest() : SyncTest(TWO_CLIENT) {} |
| 14 virtual ~TwoClientDictionarySyncTest() {} | 14 virtual ~TwoClientDictionarySyncTest() {} |
| 15 | 15 |
| 16 virtual void AddOptionalTypesToCommandLine(CommandLine* cl) OVERRIDE { | |
| 17 dictionary_helper::EnableDictionarySync(cl); | |
| 18 } | |
| 19 | |
| 20 private: | 16 private: |
| 21 DISALLOW_COPY_AND_ASSIGN(TwoClientDictionarySyncTest); | 17 DISALLOW_COPY_AND_ASSIGN(TwoClientDictionarySyncTest); |
| 22 }; | 18 }; |
| 23 | 19 |
| 24 IN_PROC_BROWSER_TEST_F(TwoClientDictionarySyncTest, Sanity) { | 20 IN_PROC_BROWSER_TEST_F(TwoClientDictionarySyncTest, Sanity) { |
| 25 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 21 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 26 dictionary_helper::LoadDictionaries(); | 22 dictionary_helper::LoadDictionaries(); |
| 27 ASSERT_TRUE(dictionary_helper::DictionariesMatch()); | 23 ASSERT_TRUE(dictionary_helper::DictionariesMatch()); |
| 28 | 24 |
| 29 std::vector<std::string> words; | 25 std::vector<std::string> words; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // Client #0 should have both "foo" and "bar" sets of words. | 152 // Client #0 should have both "foo" and "bar" sets of words. |
| 157 ASSERT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS * 2, | 153 ASSERT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS * 2, |
| 158 dictionary_helper::GetDictionarySize(0)); | 154 dictionary_helper::GetDictionarySize(0)); |
| 159 | 155 |
| 160 // The sync server and client #1 should have only "bar" set of words. | 156 // The sync server and client #1 should have only "bar" set of words. |
| 161 ASSERT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS, | 157 ASSERT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS, |
| 162 dictionary_helper::GetDictionarySize(1)); | 158 dictionary_helper::GetDictionarySize(1)); |
| 163 | 159 |
| 164 MessageLoop::current()->RunUntilIdle(); | 160 MessageLoop::current()->RunUntilIdle(); |
| 165 } | 161 } |
| OLD | NEW |