fix: re-enable the spellchecker when new language list set (#26119)
* fix: re-enable the spellchecker when new language list set Chromium recently added prefs logic to disable the spellchecker if the list of languages is empty, but the logic to re-enable if the languages are provided again lives in another part of Chromium. This change makes it so our API re-enables the spellchecker correctly when required. * chore: fix lint
This commit is contained in:
parent
6181c03df0
commit
9d18f9d54f
3 changed files with 38 additions and 3 deletions
|
@ -2,9 +2,19 @@ import * as childProcess from 'child_process';
|
|||
import * as path from 'path';
|
||||
import * as http from 'http';
|
||||
import * as v8 from 'v8';
|
||||
import { SuiteFunction, TestFunction } from 'mocha';
|
||||
|
||||
export const ifit = (condition: boolean) => (condition ? it : it.skip);
|
||||
export const ifdescribe = (condition: boolean) => (condition ? describe : describe.skip);
|
||||
const addOnly = <T>(fn: Function): T => {
|
||||
const wrapped = (...args: any[]) => {
|
||||
return fn(...args);
|
||||
};
|
||||
(wrapped as any).only = wrapped;
|
||||
(wrapped as any).skip = wrapped;
|
||||
return wrapped as any;
|
||||
};
|
||||
|
||||
export const ifit = (condition: boolean) => (condition ? it : addOnly<TestFunction>(it.skip));
|
||||
export const ifdescribe = (condition: boolean) => (condition ? describe : addOnly<SuiteFunction>(describe.skip));
|
||||
|
||||
export const delay = (time: number = 0) => new Promise(resolve => setTimeout(resolve, time));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue