Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Side by Side Diff: chrome/browser/sync/test/integration/multiple_client_dictionary_sync_test.cc

Issue 11445002: Sync user's custom spellcheck dictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add browser tests for dictionary change notifications in settings Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/string_number_conversions.h"
6 #include "chrome/browser/sync/profile_sync_service_harness.h"
7 #include "chrome/browser/sync/test/integration/dictionary_helper.h"
8 #include "chrome/browser/sync/test/integration/sync_test.h"
9
10 class MultipleClientDictionarySyncTest : public SyncTest {
11 public:
12 MultipleClientDictionarySyncTest() : SyncTest(MULTIPLE_CLIENT) {}
13 virtual ~MultipleClientDictionarySyncTest() {}
14
15 virtual void AddOptionalTypesToCommandLine(CommandLine* cl) OVERRIDE {
16 dictionary_helper::EnableDictionarySync(cl);
17 }
18
19 private:
20 DISALLOW_COPY_AND_ASSIGN(MultipleClientDictionarySyncTest);
21 };
22
23 IN_PROC_BROWSER_TEST_F(MultipleClientDictionarySyncTest, AddToOne) {
24 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
25 dictionary_helper::LoadDictionaries();
26 ASSERT_TRUE(dictionary_helper::DictionariesMatch());
27
28 ASSERT_TRUE(dictionary_helper::AddWord(0, "foo"));
29 ASSERT_TRUE(GetClient(0)->AwaitGroupSyncCycleCompletion(clients()));
30 ASSERT_TRUE(dictionary_helper::DictionariesMatch());
31
32 MessageLoop::current()->RunUntilIdle();
33 }
34
35 IN_PROC_BROWSER_TEST_F(MultipleClientDictionarySyncTest, AddSameToAll) {
36 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
37 dictionary_helper::LoadDictionaries();
38 ASSERT_TRUE(dictionary_helper::DictionariesMatch());
39
40 for (int i = 0; i < num_clients(); ++i)
41 dictionary_helper::AddWord(i, "foo");
42 ASSERT_TRUE(AwaitQuiescence());
43 ASSERT_TRUE(dictionary_helper::DictionariesMatch());
44 ASSERT_EQ(1UL, dictionary_helper::GetDictionarySize(0));
45
46 MessageLoop::current()->RunUntilIdle();
47 }
48
49 IN_PROC_BROWSER_TEST_F(MultipleClientDictionarySyncTest, AddDifferentToAll) {
50 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
51 dictionary_helper::LoadDictionaries();
52 ASSERT_TRUE(dictionary_helper::DictionariesMatch());
53
54 for (int i = 0; i < num_clients(); ++i)
55 dictionary_helper::AddWord(i, "foo" + base::IntToString(i));
56 ASSERT_TRUE(AwaitQuiescence());
57 ASSERT_TRUE(dictionary_helper::DictionariesMatch());
58 ASSERT_EQ(num_clients(),
59 static_cast<int>(dictionary_helper::GetDictionarySize(0)));
60
61 MessageLoop::current()->RunUntilIdle();
62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698