test: reliably wait for spellchecker to load (#28118)

This commit is contained in:
Cheng Zhao 2021-03-12 16:35:57 +09:00 committed by GitHub
parent 6c90411e21
commit 5b710519cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 39 deletions

View file

@ -138,6 +138,10 @@ void TriggerFatalErrorForTesting(v8::Isolate* isolate) {
v8::ExtensionConfiguration config(1, bDeps);
v8::Context::New(isolate, &config);
}
void RunUntilIdle() {
base::RunLoop().RunUntilIdle();
}
#endif
void Initialize(v8::Local<v8::Object> exports,
@ -158,6 +162,7 @@ void Initialize(v8::Local<v8::Object> exports,
dict.SetMethod("getWeaklyTrackedValues", &GetWeaklyTrackedValues);
dict.SetMethod("clearWeaklyTrackedValues", &ClearWeaklyTrackedValues);
dict.SetMethod("weaklyTrackValue", &WeaklyTrackValue);
dict.SetMethod("runUntilIdle", &RunUntilIdle);
#endif
}