Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pref to force WebGL context creation failure #17189

Merged
merged 1 commit into from Jun 7, 2017
Merged

Conversation

@bd339
Copy link
Contributor

bd339 commented Jun 6, 2017

Introduces the pref webgl.testing.context_creation_error, to force creation of a new WebGLRenderingContext to fail.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #17038 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

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
Copy link

highfive commented Jun 6, 2017

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/webglrenderingcontext.rs
  • @fitzgen: components/script/dom/webglrenderingcontext.rs
  • @emilio: components/script/dom/webglrenderingcontext.rs
@bd339 bd339 force-pushed the bd339:iss17038 branch from 548554e to 41f4ec0 Jun 6, 2017
Copy link
Member

emilio left a comment

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.

@emilio

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.

@bd339

bd339 Jun 6, 2017

Author Contributor

Good idea, I'll do that.

@@ -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.

@emilio

emilio Jun 6, 2017

Member

We should remove this and the following line, right? The test should pass now :)

@bd339 bd339 force-pushed the bd339:iss17038 branch from 41f4ec0 to 2117575 Jun 6, 2017
@bd339
Copy link
Contributor Author

bd339 commented Jun 6, 2017

@emilio is the failed Travis build something we should be worried about?

@jdm
Copy link
Member

jdm commented Jun 6, 2017

Yes. You need to run ./mach update-manifest and commit the result, since a test file was modified.

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.
@bd339 bd339 force-pushed the bd339:iss17038 branch from 443289f to c034d99 Jun 6, 2017
@emilio
Copy link
Member

emilio commented Jun 7, 2017

@bors-servo r+

Looks great, thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Jun 7, 2017

📌 Commit c034d99 has been approved by emilio

@highfive highfive assigned emilio and unassigned KiChjang Jun 7, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Jun 7, 2017

Testing commit c034d99 with merge 3db7f5d...

bors-servo added a commit that referenced this pull request Jun 7, 2017
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 7, 2017

@bors-servo bors-servo merged commit c034d99 into servo:master Jun 7, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.