1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -76,6 +76,6 @@
-[dev-dependencies.actix-files]
+[disabled.dev-dependencies.actix-files]
version = "0.6"
-[dev-dependencies.actix-web]
+[disabled.dev-dependencies.actix-web]
version = "4"
--- a/tests/common.rs
+++ b/tests/common.rs
@@ -1,5 +1,5 @@
-use actix_files as fs;
-use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer, Responder};
+//use actix_files as fs;
+//use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer, Responder};
use crossbeam_channel as cbc;
use rand::RngCore;
use std::{io::Write, path::PathBuf, sync::Arc};
@@ -11,7 +11,7 @@
tx: Arc<cbc::Sender<String>>,
}
-async fn log_handler(req: HttpRequest, data: web::Data<AppState>) -> impl Responder {
+/*async fn log_handler(req: HttpRequest, data: web::Data<AppState>) -> impl Responder {
if data.tx.send(req.uri().to_string()).is_err() {
panic!("channel send failed");
}
@@ -25,9 +25,9 @@
.content_type("text/html; charset=utf-8")
.body(format!("<html><body><p>URI: {}</p><script type=\"text/javascript>window.close();</script></body></html>", req.uri()))
}
-}
+}*/
-async fn delayed_response(req: HttpRequest) -> impl Responder {
+/*async fn delayed_response(req: HttpRequest) -> impl Responder {
let qs = req.query_string();
let ms: u64 = qs
.replace("ms=", "")
@@ -39,9 +39,9 @@
.body(format!(
"<html><body><p>Delayed by {qs}ms</p></body></html>"
))
-}
+}*/
-pub async fn check_request_received_using<F>(uri: String, host: &str, op: F)
+/*pub async fn check_request_received_using<F>(uri: String, host: &str, op: F)
where
F: FnOnce(&str, u16),
{
@@ -90,17 +90,17 @@
// stop the server
server_handle.stop(true).await;
-}
+}*/
-#[allow(dead_code)]
+/*#[allow(dead_code)]
pub async fn check_request_received(browser: Browser, uri: String) {
check_request_received_using(uri, "127.0.0.1", |url, _port| {
open_browser(browser, url).expect("failed to open browser");
})
.await;
-}
+}*/
-#[allow(dead_code)]
+/*#[allow(dead_code)]
pub async fn check_local_file<F>(browser: Browser, html_dir: Option<PathBuf>, url_op: F)
where
F: FnOnce(&PathBuf) -> String,
@@ -127,13 +127,13 @@
})
.await;
let _ = std::fs::remove_file(&pb);
-}
+}*/
-#[allow(dead_code)]
+/*#[allow(dead_code)]
pub async fn check_browser(browser: Browser, platform: &str) {
check_request_received(browser, format!("/{platform}")).await;
check_request_received(browser, format!("/{platform}/😀😀😀")).await;
-}
+}*/
const URI_PNG_1PX: &str = "/img/1px.png";
Index: webbrowser/tests/test_unix.rs
===================================================================
--- webbrowser.orig/tests/test_unix.rs
+++ webbrowser/tests/test_unix.rs
@@ -9,11 +9,11 @@ mod tests {
use serial_test::serial;
use webbrowser::Browser;
- #[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+ /*#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
#[serial]
async fn test_open_default() {
check_browser(Browser::Default, TEST_PLATFORM).await;
- }
+ }*/
#[test]
fn test_existence_default() {
@@ -25,7 +25,7 @@ mod tests {
assert!(!Browser::Safari.exists(), "should not have found Safari");
}
- #[cfg(not(feature = "hardened"))]
+ /*#[cfg(not(feature = "hardened"))]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
#[serial]
async fn test_local_file_abs_path() {
@@ -60,7 +60,7 @@ mod tests {
.to_string()
})
.await;
- }
+ }*/
#[cfg(feature = "hardened")]
#[test]
--- a/tests/test_wasm.rs
+++ b/tests/test_wasm.rs
@@ -5,14 +5,14 @@ mod common;
mod tests {
const TEST_PLATFORM: &str = "wasm32";
- use super::common::check_request_received_using;
+ //use super::common::check_request_received_using;
use std::fs;
use std::path::PathBuf;
// to run this test, run it as:
// cargo test --test test_wasm32 -- --ignored
//
- #[ignore]
+ /*#[ignore]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_wasm32() {
let uri = &format!("/{TEST_PLATFORM}");
@@ -43,5 +43,5 @@ mod tests {
status.expect("browser open failed");
})
.await;
- }
+ }*/
}
|