aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/tests/filemanager_thread.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2020-02-14 21:24:35 -0500
committerGitHub <noreply@github.com>2020-02-14 21:24:35 -0500
commit4c5ec9da27b4ff1e7175d9f1e8994d7ba0922b3d (patch)
treef373d026e3f6949c67586b55ace8501a235b96b4 /components/net/tests/filemanager_thread.rs
parent1987061a3743c793763866c4719e9b7678a67d55 (diff)
parent780a1bd6cbafd8961d575385bee4c9e06376061b (diff)
downloadservo-4c5ec9da27b4ff1e7175d9f1e8994d7ba0922b3d.tar.gz
servo-4c5ec9da27b4ff1e7175d9f1e8994d7ba0922b3d.zip
Auto merge of #25724 - gterzian:use_rayon_for_file_threads, r=Manishearth
Use rayon for file operations off the main resource thread FIX #25723 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] 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. -->
Diffstat (limited to 'components/net/tests/filemanager_thread.rs')
-rw-r--r--components/net/tests/filemanager_thread.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/net/tests/filemanager_thread.rs b/components/net/tests/filemanager_thread.rs
index baf38a80392..9438fcc88ee 100644
--- a/components/net/tests/filemanager_thread.rs
+++ b/components/net/tests/filemanager_thread.rs
@@ -6,6 +6,7 @@ use crate::create_embedder_proxy;
use embedder_traits::FilterPattern;
use ipc_channel::ipc;
use net::filemanager_thread::FileManager;
+use net::resource_thread::CoreResourceThreadPool;
use net_traits::blob_url_store::BlobURLStoreError;
use net_traits::filemanager_thread::{
FileManagerThreadError, FileManagerThreadMsg, ReadFileProgress,
@@ -14,10 +15,13 @@ use servo_config::set_pref;
use std::fs::File;
use std::io::Read;
use std::path::PathBuf;
+use std::sync::Arc;
#[test]
fn test_filemanager() {
- let filemanager = FileManager::new(create_embedder_proxy());
+ let pool = CoreResourceThreadPool::new(1);
+ let pool_handle = Arc::new(pool);
+ let filemanager = FileManager::new(create_embedder_proxy(), Arc::downgrade(&pool_handle));
set_pref!(dom.testing.html_input_element.select_files.enabled, true);
// Try to open a dummy file "components/net/tests/test.jpeg" in tree