Skip to content

Add filepicker - #11717

Merged
bors-servo merged 1 commit into
servo:masterfrom
izgzhen:filepicker
Jun 14, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
izgzhen:filepicker

Conversation

@izgzhen

@izgzhen izgzhen commented Jun 10, 2016 •

Copy link
Copy Markdown
Contributor

Add file picker based on tinyfiledialog to the file manager implementation.

Changes:

  • Add the picker invocation code
  • Rewrite unit test to accommodate the change
  • Patch up htmlinputelement to make things work

Related to #11131.


This change is Reviewable

@highfive highfive assigned ghost Jun 10, 2016
@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/net/filemanager_thread.rs, components/script/dom/htmlinputelement.rs, components/net_traits/filemanager_thread.rs, components/net_traits/filemanager_thread.rs

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

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 10, 2016
@izgzhen

izgzhen commented Jun 10, 2016

Copy link
Copy Markdown
Contributor Author

Still work in progress, I have one doubt about how to refactor the original unit test of filemanager_thread (tests/unit/net/filemanager_thread.rs): Since we are sending a SelectFile to the file manager, it will cause the interactive dialog to pop up and this might not be testable for a CI.

@Manishearth Manishearth self-assigned this Jun 11, 2016
@izgzhen

izgzhen commented Jun 11, 2016 •

Copy link
Copy Markdown
Contributor Author

Forget to mention: Another problem is we might need an inverse of mime_guess, which when given mime types, can give us back a list of possible file extensions. relevant spec: https://html.spec.whatwg.org/multipage/forms.html#attr-input-accept.

@jdm

jdm commented Jun 11, 2016

Copy link
Copy Markdown
Member

Make it testable the same way we test HTTP authorization dialogs: use a trait in the code that invokes the UI, and have tests provide an implementation that doesn't use the actual dialog.

@Manishearth

Copy link
Copy Markdown
Member

Yeah, that's a better solution.

@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@izgzhen

izgzhen commented Jun 12, 2016 •

Copy link
Copy Markdown
Contributor Author

The test-unit is fixed. Still have filter pattern to fill.

@highfive

Copy link
Copy Markdown

New code was committed to pull request.

}

fn filter_from_accept(_s: DOMString) -> Vec<FilterPattern> {
unimplemented!()

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.

should we just return an empty vector with a todo so that this doesn't crash?

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.

@Manishearth I contacted upstream, and the functionality necessary for this is implemented, so I am waiting for him to upload the new version actually 😅

@Manishearth Manishearth Jun 14, 2016 •

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.

Nice!

So that this can merge, though, could we still use the empty vec (till that gets implemented) so that it doesn't crash and can be used?

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.

good, I will fix it another day

@Manishearth

Manishearth commented Jun 14, 2016 •

Copy link
Copy Markdown
Member

r=me with that unimplemented replaced with an empty vec and a todo

@bors-servo delegate+

@bors-servo

Copy link
Copy Markdown
Contributor

✌️ @izgzhen can now approve this pull request

@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@izgzhen

izgzhen commented Jun 14, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo r=Manishearth

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 0406f1b has been approved by Manishearth

@highfive highfive unassigned ghost Jun 14, 2016
@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. labels Jun 14, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 0406f1b with merge 386b52b...

bors-servo pushed a commit that referenced this pull request Jun 14, 2016
Add filepicker

Add file picker based on tinyfiledialog to the file manager implementation.

Changes:
- [x] Add the picker invocation code
- [x] Rewrite unit test to accommodate the change
- [x] Patch up `htmlinputelement` to make things work

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

---
<!-- 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 are related to #11131.

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11717)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - windows

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jun 14, 2016
@izgzhen

izgzhen commented Jun 14, 2016

Copy link
Copy Markdown
Contributor Author

Ahh nice Windows..... = = I should have thought that

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jun 14, 2016
@highfive

Copy link
Copy Markdown

New code was committed to pull request.

bors-servo pushed a commit that referenced this pull request Jun 14, 2016
Add filepicker

Add file picker based on tinyfiledialog to the file manager implementation.

Changes:
- [x] Add the picker invocation code
- [x] Rewrite unit test to accommodate the change
- [x] Patch up `htmlinputelement` to make things work

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

---
<!-- 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 are related to #11131.

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11717)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - windows

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jun 14, 2016
@Manishearth

Copy link
Copy Markdown
Member
C:\buildbot\slave\windows\build\components\net\filemanager_thread.rs:17:5: 17:20 error: unresolved import `tinyfiledialogs`. There is no `tinyfiledialogs` in the crate root [E0432]
C:\buildbot\slave\windows\build\components\net\filemanager_thread.rs:17 use tinyfiledialogs;

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jun 14, 2016
@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 14, 2016
@Manishearth

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 256c7e8 has been approved by Manishearth

@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. labels Jun 14, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 256c7e8 with merge 0cfae3a...

bors-servo pushed a commit that referenced this pull request Jun 14, 2016
Add filepicker

Add file picker based on tinyfiledialog to the file manager implementation.

Changes:
- [x] Add the picker invocation code
- [x] Rewrite unit test to accommodate the change
- [x] Patch up `htmlinputelement` to make things work

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

---
<!-- 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 are related to #11131.

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11717)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jun 14, 2016
@highfive

Copy link
Copy Markdown
  ▶ CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/change_parentage.html
  │ 
  │ Xlib:  extension &#34;XFree86-VidModeExtension&#34; missing on display &#34;:0&#34;.
  │ ERROR:constellation::constellation: Panic: ScriptThread: received an event message for a layout channel that is not associated with this script thread.This is a bug.
  │ ERROR:constellation::constellation: Backtrace:
  │ frame #0  - 0x00007f86b87b824d - backtrace::backtrace::trace::hccde8df28b4db2a2
  │ frame #1  - 0x00007f86b87b81d5 - backtrace::capture::Backtrace::new::h42f95930bb8c5ee8
  │ frame #2  - 0x00007f86b77df219 - _&lt;F as alloc..boxed..FnBox&lt;A&gt;&gt;::call_box::h89adae1a802be550
  │ frame #3  - 0x00007f86b87a9a88 - util::panicking::initiate_panic_hook::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::he2b22674ad1748f3
  │ frame #4  - 0x00007f86b8a7766c - std::panicking::rust_panic_with_hook::h983af77c1a2e581b
  │ frame #5  - 0x00007f86b8a91a71 - std::panicking::begin_panic::he426e15a3766089a
  │ frame #6  - 0x00007f86b8a78eda - std::panicking::begin_panic_fmt::hdddb415186c241e7
  │ frame #7  - 0x00007f86b8a91a0e - rust_begin_unwind
  │ frame #8  - 0x00007f86b8ac800f - core::panicking::panic_fmt::hf4e16cb7f0d41a25
  │ frame #9  - 0x00007f86b8acf6c4 - core::option::expect_failed::hdb92832549f56a85
  │ frame #10 - 0x00007f86b77ec251 - script::script_thread::ScriptThread::handle_msg_from_script::h47e979ae1e7fb676
  │ frame #11 - 0x00007f86b783806f - script::script_thread::ScriptThread::handle_msgs::_$u7b$$u7b$closure$u7d$$u7d$::hb50cf7fd97943b65
  │ frame #12 - 0x00007f86b781f607 - script::script_thread::ScriptThread::handle_msgs::h1e1abab71191c950
  │ frame #13 - 0x00007f86b77dd907 - std::panicking::try::call::h78dcd5319adf08fa
  │ frame #14 - 0x00007f86b8a9bc6b - __rust_try
  │ frame #15 - 0x00007f86b8a9bc0e - __rust_maybe_catch_panic
  │ frame #16 - 0x00007f86b77deb7d - _&lt;F as alloc..boxed..FnBox&lt;A&gt;&gt;::call_box::hce043844655ea6a9
  │ frame #17 - 0x00007f86b8a8fc34 - std::sys::thread::Thread::new::thread_start::h9c883b6d445ece46
  │ frame #18 - 0x00007f86b48cf183 - start_thread
  │ frame #19 - 0x00007f86b43e637c - clone
  │ frame #20 - 0x0000000000000000 - &lt;unknown&gt;
  │ 
  └ ERROR:constellation::constellation: Pipeline failed in hard-fail mode.  Crashing!

@jdm

jdm commented Jun 14, 2016

Copy link
Copy Markdown
Member

@bors-servo

Copy link
Copy Markdown
Contributor

⚡ Previous build results for android, arm32, arm64, linux-dev, mac-rel-wpt, windows are reusable. Rebuilding only linux-rel, mac-dev-unit, mac-rel-css...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jun 14, 2016
@highfive

Copy link
Copy Markdown
  ▶ CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/change_parentage.html
  │ 
  │ Xlib:  extension &#34;XFree86-VidModeExtension&#34; missing on display &#34;:0&#34;.
  │ ERROR:constellation::constellation: Panic: ScriptThread: received an event message for a layout channel that is not associated with this script thread.This is a bug.
  │ ERROR:constellation::constellation: Backtrace:
  │ frame #0  - 0x00007f90f9f258ad - backtrace::backtrace::trace::hccde8df28b4db2a2
  │ frame #1  - 0x00007f90f9f25835 - backtrace::capture::Backtrace::new::h42f95930bb8c5ee8
  │ frame #2  - 0x00007f90f8f4c899 - _&lt;F as alloc..boxed..FnBox&lt;A&gt;&gt;::call_box::h89adae1a802be550
  │ frame #3  - 0x00007f90f9f170e8 - util::panicking::initiate_panic_hook::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::he2b22674ad1748f3
  │ frame #4  - 0x00007f90fa1e4ccc - std::panicking::rust_panic_with_hook::h983af77c1a2e581b
  │ frame #5  - 0x00007f90fa1ff0d1 - std::panicking::begin_panic::he426e15a3766089a
  │ frame #6  - 0x00007f90fa1e653a - std::panicking::begin_panic_fmt::hdddb415186c241e7
  │ frame #7  - 0x00007f90fa1ff06e - rust_begin_unwind
  │ frame #8  - 0x00007f90fa23566f - core::panicking::panic_fmt::hf4e16cb7f0d41a25
  │ frame #9  - 0x00007f90fa23cd24 - core::option::expect_failed::hdb92832549f56a85
  │ frame #10 - 0x00007f90f8f598d1 - script::script_thread::ScriptThread::handle_msg_from_script::h47e979ae1e7fb676
  │ frame #11 - 0x00007f90f8fa56ef - script::script_thread::ScriptThread::handle_msgs::_$u7b$$u7b$closure$u7d$$u7d$::hb50cf7fd97943b65
  │ frame #12 - 0x00007f90f8f8cc87 - script::script_thread::ScriptThread::handle_msgs::h1e1abab71191c950
  │ frame #13 - 0x00007f90f8f4af87 - std::panicking::try::call::h78dcd5319adf08fa
  │ frame #14 - 0x00007f90fa2092cb - __rust_try
  │ frame #15 - 0x00007f90fa20926e - __rust_maybe_catch_panic
  │ frame #16 - 0x00007f90f8f4c1fd - _&lt;F as alloc..boxed..FnBox&lt;A&gt;&gt;::call_box::hce043844655ea6a9
  │ frame #17 - 0x00007f90fa1fd294 - std::sys::thread::Thread::new::thread_start::h9c883b6d445ece46
  │ frame #18 - 0x00007f90f603c181 - start_thread
  │ frame #19 - 0x00007f90f5b5347c - __clone
  │ frame #20 - 0x0000000000000000 - &lt;unknown&gt;
  │ 
  └ ERROR:constellation::constellation: Pipeline failed in hard-fail mode.  Crashing!

@izgzhen

izgzhen commented Jun 14, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo

Copy link
Copy Markdown
Contributor

⚡ Previous build results for android, arm32, arm64, linux-dev, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows are reusable. Rebuilding only linux-rel...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-tests-failed The changes caused existing tests to fail.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants