Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd pref to force WebGL context creation failure #17189
Conversation
highfive
commented
Jun 6, 2017
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @KiChjang (or someone else) soon. |
highfive
commented
Jun 6, 2017
|
Looks good, just one nit to avoid duplicating code. |
| @@ -200,6 +201,18 @@ impl WebGLRenderingContext { | |||
| #[allow(unrooted_must_root)] | |||
| pub fn new(window: &Window, canvas: &HTMLCanvasElement, size: Size2D<i32>, attrs: GLContextAttributes) | |||
| -> Option<Root<WebGLRenderingContext>> { | |||
| if let Some(true) = PREFS.get("webgl.testing.context_creation_error").as_boolean() { | |||
This comment has been minimized.
This comment has been minimized.
emilio
Jun 6, 2017
Member
Let's move this check to new_inherited, and return Err("WebGLRenderingContext creation error forced by pref..".into()) from there, so we don't duplicate all the event handling.
This comment has been minimized.
This comment has been minimized.
| @@ -1,5 +1,5 @@ | |||
| [context_creation_error.html] | |||
| type: reftest | |||
| prefs: ["webgl.testing.context_creation_error:true"] | |||
| [WebGLContextEvent "webglcontextcreationerror" event] | |||
This comment has been minimized.
This comment has been minimized.
emilio
Jun 6, 2017
Member
We should remove this and the following line, right? The test should pass now :)
|
@emilio is the failed Travis build something we should be worried about? |
|
Yes. You need to run |
The pref `webgl.testing.context_creation_error` will cause creation of a new WebGLRenderingContext to fail, iff set to true. Also update test expectation of `context_creation_error.html` to pass.
|
@bors-servo r+ Looks great, thanks! |
|
|
Add pref to force WebGL context creation failure <!-- Please describe your changes on the following line: --> Introduces the pref `webgl.testing.context_creation_error`, to force creation of a new WebGLRenderingContext to fail. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #17038 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17189) <!-- Reviewable:end -->
|
|
bd339 commentedJun 6, 2017
•
edited by larsbergstrom
Introduces the pref
webgl.testing.context_creation_error, to force creation of a new WebGLRenderingContext to fail../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is