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 "chrome/browser/sync/test/integration/dictionary_helper.h" | 5 #include "chrome/browser/sync/test/integration/dictionary_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 SpellcheckCustomDictionary* GetVerifierDictionary() { | 50 SpellcheckCustomDictionary* GetVerifierDictionary() { |
51 return SpellcheckServiceFactory::GetForContext( | 51 return SpellcheckServiceFactory::GetForContext( |
52 sync_datatype_helper::test()->verifier())->GetCustomDictionary(); | 52 sync_datatype_helper::test()->verifier())->GetCustomDictionary(); |
53 } | 53 } |
54 | 54 |
55 void LoadDictionary(SpellcheckCustomDictionary* dictionary) { | 55 void LoadDictionary(SpellcheckCustomDictionary* dictionary) { |
56 if (dictionary->IsLoaded()) | 56 if (dictionary->IsLoaded()) |
57 return; | 57 return; |
58 base::RunLoop run_loop; | 58 base::RunLoop run_loop; |
59 DictionaryLoadObserver observer( | 59 DictionaryLoadObserver observer(content::GetQuitTaskForRunLoop(&run_loop)); |
60 content::GetDeferredQuitTaskForRunLoop(&run_loop)); | |
61 dictionary->AddObserver(&observer); | 60 dictionary->AddObserver(&observer); |
62 dictionary->Load(); | 61 dictionary->Load(); |
63 content::RunThisRunLoop(&run_loop); | 62 content::RunThisRunLoop(&run_loop); |
64 dictionary->RemoveObserver(&observer); | 63 dictionary->RemoveObserver(&observer); |
65 ASSERT_TRUE(dictionary->IsLoaded()); | 64 ASSERT_TRUE(dictionary->IsLoaded()); |
66 } | 65 } |
67 | 66 |
68 } // namespace | 67 } // namespace |
69 | 68 |
70 | 69 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 159 |
161 bool NumDictionaryEntriesChecker::IsExitConditionSatisfied() { | 160 bool NumDictionaryEntriesChecker::IsExitConditionSatisfied() { |
162 return dictionary_helper::GetDictionarySize(index_) == num_words_; | 161 return dictionary_helper::GetDictionarySize(index_) == num_words_; |
163 } | 162 } |
164 | 163 |
165 std::string NumDictionaryEntriesChecker::GetDebugMessage() const { | 164 std::string NumDictionaryEntriesChecker::GetDebugMessage() const { |
166 return base::StringPrintf( | 165 return base::StringPrintf( |
167 "Waiting for client %d: %" PRIuS " / %" PRIuS " words downloaded", index_, | 166 "Waiting for client %d: %" PRIuS " / %" PRIuS " words downloaded", index_, |
168 dictionary_helper::GetDictionarySize(index_), num_words_); | 167 dictionary_helper::GetDictionarySize(index_), num_words_); |
169 } | 168 } |
OLD | NEW |