mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
Better OSR tests (#12817)
* Add features.isOffscreenRenderingEnabled() * Use .isOffscreenRenderingEnabled() to determine if OSR is available * Add a helper closeTheWindow() function * Skip OSR tests if they are disabled
This commit is contained in:
committed by
Charles Kerr
parent
0a2dc1efb0
commit
3fd0ec99ae
@@ -7,6 +7,14 @@
|
||||
|
||||
namespace {
|
||||
|
||||
bool IsOffscreenRenderingEnabled() {
|
||||
#if defined(ENABLE_OSR)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool IsPDFViewerEnabled() {
|
||||
#if defined(ENABLE_PDF_VIEWER)
|
||||
return true;
|
||||
@@ -20,6 +28,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
mate::Dictionary dict(context->GetIsolate(), exports);
|
||||
dict.SetMethod("isOffscreenRenderingEnabled", &IsOffscreenRenderingEnabled);
|
||||
dict.SetMethod("isPDFViewerEnabled", &IsPDFViewerEnabled);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user