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

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

Issue 11445002: Sync user's custom spellcheck dictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years 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/performance/sync_timing_helper.h"
9 #include "chrome/browser/sync/test/integration/sync_test.h"
10
11 class DictionarySyncPerfTest : public SyncTest {
12 public:
13 DictionarySyncPerfTest() : SyncTest(TWO_CLIENT) {}
14 virtual ~DictionarySyncPerfTest() {}
15
16 virtual void AddOptionalTypesToCommandLine(CommandLine* cl) OVERRIDE {
17 dictionary_helper::EnableDictionarySync(cl);
18 }
19
20 private:
21 DISALLOW_COPY_AND_ASSIGN(DictionarySyncPerfTest);
22 };
23
24 IN_PROC_BROWSER_TEST_F(DictionarySyncPerfTest, P0) {
25 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
26 dictionary_helper::LoadDictionaries();
27 ASSERT_TRUE(dictionary_helper::DictionariesMatch());
28
29 base::TimeDelta dt;
30 const size_t kNumWords = 1300;
31 for (size_t i = 0; i < kNumWords; ++i)
32 ASSERT_TRUE(dictionary_helper::AddWord(0, "foo" + base::Uint64ToString(i)));
33 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1));
34 ASSERT_EQ(kNumWords, dictionary_helper::GetDictionarySize(1));
35 SyncTimingHelper::PrintResult("dictionary", "add_words", dt);
36
37 for (size_t i = 0; i < kNumWords; ++i) {
38 ASSERT_TRUE(dictionary_helper::RemoveWord(
39 0, "foo" + base::Uint64ToString(i)));
40 }
41 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1));
42 ASSERT_EQ(0UL, dictionary_helper::GetDictionarySize(1));
43 SyncTimingHelper::PrintResult("dictionary", "remove_words", dt);
44
45 MessageLoop::current()->RunUntilIdle();
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698