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:
Alexey Kuzmin
2020-05-23 20:05:37 +02:00
committed by GitHub
parent 98033f8520
commit 8803c12715
3 changed files with 11 additions and 3 deletions

View File

@@ -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);

View File

@@ -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 () => {

View File

@@ -9,6 +9,7 @@ declare const ENABLE_VIEW_API: boolean;
declare namespace NodeJS {
interface FeaturesBinding {
isBuiltinSpellCheckerEnabled(): boolean;
isDesktopCapturerEnabled(): boolean;
isOffscreenRenderingEnabled(): boolean;
isRemoteModuleEnabled(): boolean;