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:
parent
0a2dc1efb0
commit
3fd0ec99ae
2 changed files with 22 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue