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 MultipleClientDictionarySyncTest : public SyncTest { | 11 class MultipleClientDictionarySyncTest : public SyncTest { |
12 public: | 12 public: |
13 MultipleClientDictionarySyncTest() : SyncTest(MULTIPLE_CLIENT) {} | 13 MultipleClientDictionarySyncTest() : SyncTest(MULTIPLE_CLIENT) {} |
14 virtual ~MultipleClientDictionarySyncTest() {} | 14 virtual ~MultipleClientDictionarySyncTest() {} |
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(MultipleClientDictionarySyncTest); | 17 DISALLOW_COPY_AND_ASSIGN(MultipleClientDictionarySyncTest); |
22 }; | 18 }; |
23 | 19 |
24 IN_PROC_BROWSER_TEST_F(MultipleClientDictionarySyncTest, AddToOne) { | 20 IN_PROC_BROWSER_TEST_F(MultipleClientDictionarySyncTest, AddToOne) { |
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 ASSERT_TRUE(dictionary_helper::AddWord(0, "foo")); | 25 ASSERT_TRUE(dictionary_helper::AddWord(0, "foo")); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 dictionary_helper::GetDictionarySize(i)); | 97 dictionary_helper::GetDictionarySize(i)); |
102 } | 98 } |
103 | 99 |
104 // Client #0 should still have only 1300 words after syncing all other | 100 // Client #0 should still have only 1300 words after syncing all other |
105 // clients, because it has the same data as the sync server. | 101 // clients, because it has the same data as the sync server. |
106 ASSERT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS, | 102 ASSERT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS, |
107 dictionary_helper::GetDictionarySize(0)); | 103 dictionary_helper::GetDictionarySize(0)); |
108 | 104 |
109 MessageLoop::current()->RunUntilIdle(); | 105 MessageLoop::current()->RunUntilIdle(); |
110 } | 106 } |
OLD | NEW |