mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
test: do not run spellchecker tests if the feature is disabled (9-x-y) (#23724)
* test: do not run SpellChecker tests if the features is disabled at build time * fixup! test: do not run SpellChecker tests if the features is disabled at build time * fixup! test: do not run SpellChecker tests if the features is disabled at build time
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
|
||||
namespace {
|
||||
|
||||
bool IsBuiltinSpellCheckerEnabled() {
|
||||
return BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER);
|
||||
}
|
||||
|
||||
bool IsDesktopCapturerEnabled() {
|
||||
return BUILDFLAG(ENABLE_DESKTOP_CAPTURER);
|
||||
}
|
||||
@@ -66,6 +70,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
dict.SetMethod("isBuiltinSpellCheckerEnabled", &IsBuiltinSpellCheckerEnabled);
|
||||
dict.SetMethod("isDesktopCapturerEnabled", &IsDesktopCapturerEnabled);
|
||||
dict.SetMethod("isOffscreenRenderingEnabled", &IsOffscreenRenderingEnabled);
|
||||
dict.SetMethod("isRemoteModuleEnabled", &IsRemoteModuleEnabled);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { BrowserWindow, Session, session } from 'electron';
|
||||
|
||||
import { expect } from 'chai';
|
||||
import { BrowserWindow, Session, session } from 'electron';
|
||||
import { ifdescribe } from './spec-helpers';
|
||||
import { closeWindow } from './window-helpers';
|
||||
|
||||
describe('spellchecker', () => {
|
||||
const features = process.electronBinding('features');
|
||||
|
||||
ifdescribe(features.isBuiltinSpellCheckerEnabled())('spellchecker', () => {
|
||||
let w: BrowserWindow;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
1
typings/internal-ambient.d.ts
vendored
1
typings/internal-ambient.d.ts
vendored
@@ -9,6 +9,7 @@ declare const ENABLE_VIEW_API: boolean;
|
||||
|
||||
declare namespace NodeJS {
|
||||
interface FeaturesBinding {
|
||||
isBuiltinSpellCheckerEnabled(): boolean;
|
||||
isDesktopCapturerEnabled(): boolean;
|
||||
isOffscreenRenderingEnabled(): boolean;
|
||||
isRemoteModuleEnabled(): boolean;
|
||||
|
||||
Reference in New Issue
Block a user