Skip to content

Disabled tinyfiledialogs when running headless - #15967

Merged
bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:headless-disable-tinyfd
Mar 16, 2017
Merged

bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:headless-disable-tinyfd

Conversation

@asajeffrey

@asajeffrey asajeffrey commented Mar 15, 2017 •

Copy link
Copy Markdown
Contributor

Disable tinyfiledialogs when running in headless mode.



This change is Reviewable

@asajeffrey asajeffrey added I-intermittent Problem reproduces intermittently. I-papercut Small but painful. labels Mar 15, 2017
@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/window.rs, components/script/dom/permissions.rs
  • @KiChjang: components/net/filemanager_thread.rs, components/script/dom/window.rs, components/script/dom/permissions.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 15, 2017
@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify net and script code, but no tests are modified. Please consider adding a test!

@asajeffrey

Copy link
Copy Markdown
Contributor Author

cc @jdm

Comment thread components/net/filemanager_thread.rs Outdated
PREFS.get("dom.testing.htmlinputelement.select_files.enabled")
.as_boolean().unwrap_or(false)
.as_boolean().unwrap_or(false) &&
!opts::get().headless

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change necessary? Wont' this make us use TFD when we're in headless mode, since the callers invoke the UI when it returns false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, got the semantics of this flag inverted.

@jdm jdm added S-awaiting-answer Someone asked a question that requires an answer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 15, 2017
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 15, 2017
@asajeffrey asajeffrey added S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-review There is new code that needs to be reviewed. S-awaiting-answer Someone asked a question that requires an answer. labels Mar 15, 2017
@asajeffrey

Copy link
Copy Markdown
Contributor Author

The unit tests were failing because the UI provider wasn't being called in headless mode. The fix is to move the headless check inside the UI provider.

@jdm

jdm commented Mar 16, 2017

Copy link
Copy Markdown
Member

Looks good to merge after squashing.

@jdm jdm added S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 16, 2017
@asajeffrey
asajeffrey force-pushed the headless-disable-tinyfd branch from f714b22 to f05577c Compare March 16, 2017 13:48
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 16, 2017
@asajeffrey

Copy link
Copy Markdown
Contributor Author

Squashed. @bors-servo r=jdm

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit f05577c has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Mar 16, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f05577c with merge e34aac0...

bors-servo pushed a commit that referenced this pull request Mar 16, 2017
Disabled tinyfiledialogs when running headless

<!-- Please describe your changes on the following line: -->

Disable tinyfiledialogs when running in headless mode.

---
<!-- 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 #15965 and #15962.
- [X] These changes do not require tests because we don't test tinyfiledialog pop-ups.

<!-- 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/15967)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev
Approved by: jdm
Pushing e34aac0 to master...

@bors-servo
bors-servo merged commit f05577c into servo:master Mar 16, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-intermittent Problem reproduces intermittently. I-papercut Small but painful.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable tinyfiledialog popups when running in headless mode

4 participants