Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / performance / dictionary_sync_perf_test.cc
blobac2a1b5a419c3fb923ddba6b26c6f9f4bea72ef2
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.
5 #include "base/strings/string_number_conversions.h"
6 #include "chrome/browser/sync/test/integration/dictionary_helper.h"
7 #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h"
8 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
9 #include "chrome/browser/sync/test/integration/sync_test.h"
10 #include "chrome/common/spellcheck_common.h"
12 class DictionarySyncPerfTest : public SyncTest {
13 public:
14 DictionarySyncPerfTest() : SyncTest(TWO_CLIENT) {}
15 ~DictionarySyncPerfTest() override {}
17 private:
18 DISALLOW_COPY_AND_ASSIGN(DictionarySyncPerfTest);
21 IN_PROC_BROWSER_TEST_F(DictionarySyncPerfTest, P0) {
22 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
23 dictionary_helper::LoadDictionaries();
24 ASSERT_TRUE(dictionary_helper::DictionariesMatch());
26 base::TimeDelta dt;
27 for (size_t i = 0;
28 i < chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS;
29 ++i) {
30 ASSERT_TRUE(dictionary_helper::AddWord(
31 0, "foo" + base::Uint64ToString(i)));
33 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1));
34 ASSERT_EQ(chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS,
35 dictionary_helper::GetDictionarySize(1));
36 SyncTimingHelper::PrintResult("dictionary", "add_words", dt);
38 for (size_t i = 0;
39 i < chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS;
40 ++i) {
41 ASSERT_TRUE(dictionary_helper::RemoveWord(
42 0, "foo" + base::Uint64ToString(i)));
44 dt = SyncTimingHelper::TimeMutualSyncCycle(GetClient(0), GetClient(1));
45 ASSERT_EQ(0UL, dictionary_helper::GetDictionarySize(1));
46 SyncTimingHelper::PrintResult("dictionary", "remove_words", dt);