Index: device/power_save_blocker/power_save_blocker_x11.cc |
diff --git a/device/power_save_blocker/power_save_blocker_x11.cc b/device/power_save_blocker/power_save_blocker_x11.cc |
index 8c96590eaab5f29bf88ce0662560af775c9dc893..3a77287647b1d7fa0440202d1cd5e807e8bd8e3f 100644 |
--- a/device/power_save_blocker/power_save_blocker_x11.cc |
+++ b/device/power_save_blocker/power_save_blocker_x11.cc |
@@ -441,6 +441,10 @@ bool PowerSaveBlocker::Delegate::XSSAvailable() { |
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless)) |
return false; |
XDisplay* display = gfx::GetXDisplay(); |
+ // In service_unittests context, XDisplay is not well initialized. passing a |
blundell
2017/05/16 13:37:55
Did you check whether it's possible to initialize
ke.he
2017/05/17 07:19:54
Yes, I followed how the browser_main_runner.cc ini
blundell
2017/05/17 09:01:42
Short-circuiting out early in the test isn't conce
|
+ // nullptr to XScreenSaverQueryExtension() will cause crash. |
+ if (!display) |
+ return false; |
int dummy; |
int major; |
int minor; |