StartFrameBufferWithOptions causes an X virtual frame buffer to start before the WebDriver service. The frame buffer process will be terminated when the service itself is stopped.
(options FrameBufferOptions)
| 75 | // the WebDriver service. The frame buffer process will be terminated when the |
| 76 | // service itself is stopped. |
| 77 | func StartFrameBufferWithOptions(options FrameBufferOptions) ServiceOption { |
| 78 | return func(s *Service) error { |
| 79 | if s.display != "" { |
| 80 | return fmt.Errorf("service display already set: %v", s.display) |
| 81 | } |
| 82 | if s.xauthPath != "" { |
| 83 | return fmt.Errorf("service xauth path already set: %v", s.xauthPath) |
| 84 | } |
| 85 | if s.xvfb != nil { |
| 86 | return fmt.Errorf("service Xvfb instance already running") |
| 87 | } |
| 88 | fb, err := NewFrameBufferWithOptions(options) |
| 89 | if err != nil { |
| 90 | return fmt.Errorf("error starting frame buffer: %v", err) |
| 91 | } |
| 92 | s.xvfb = fb |
| 93 | return Display(fb.Display, fb.AuthPath)(s) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // Output specifies that the WebDriver service should log to the provided |
| 98 | // writer. |
no test coverage detected
searching dependent graphs…