Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tests"
authors = ["Aaron Hill <[email protected]>"]
edition.workspace = true
edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ruffle_test_framework"
authors.workspace = true
edition.workspace = true
edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/src/backends/audio.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ruffle_core::backend::audio::{
swf, AudioBackend, AudioMixer, DecodeError, RegisterError, SoundHandle, SoundInstanceHandle,
SoundStreamInfo, SoundTransform,
AudioBackend, AudioMixer, DecodeError, RegisterError, SoundHandle, SoundInstanceHandle,
SoundStreamInfo, SoundTransform, swf,
};
use ruffle_core::impl_audio_mixer_backend;

Expand Down
4 changes: 2 additions & 2 deletions tests/framework/src/backends/navigator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use async_channel::{Receiver, Sender};
use percent_encoding::percent_decode_str;
use ruffle_core::backend::log::LogBackend;
use ruffle_core::backend::navigator::{
async_return, create_fetch_error, ErrorResponse, NavigationMethod, NavigatorBackend,
NullExecutor, NullSpawner, OwnedFuture, Request, SuccessResponse,
ErrorResponse, NavigationMethod, NavigatorBackend, NullExecutor, NullSpawner, OwnedFuture,
Request, SuccessResponse, async_return, create_fetch_error,
};
use ruffle_core::indexmap::IndexMap;
use ruffle_core::loader::Error;
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/src/backends/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use std::collections::HashMap;
use crate::test::Font;
use chrono::{DateTime, Utc};
use ruffle_core::{
FontFileData, FontQuery,
backend::ui::{
DialogLoaderError, DialogResultFuture, FileDialogResult, FileFilter, FontDefinition,
FullscreenError, LanguageIdentifier, MouseCursor, UiBackend, US_ENGLISH,
FullscreenError, LanguageIdentifier, MouseCursor, US_ENGLISH, UiBackend,
},
FontFileData, FontQuery,
};
use url::Url;

Expand Down
4 changes: 2 additions & 2 deletions tests/framework/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use crate::options::approximations::Approximations;
use crate::options::font::{DefaultFontsOptions, FontOptions, FontSortOptions};
use crate::options::image_comparison::ImageComparison;
use crate::options::player::PlayerOptions;
use anyhow::{bail, Result};
use anyhow::{Result, bail};
use serde::Deserialize;
use std::collections::{HashMap, HashSet};
use toml::de::{DeTable, DeValue};
use toml::Spanned;
use toml::de::{DeTable, DeValue};
use vfs::VfsPath;

fn merge_into_subtest<'a>(
Expand Down
15 changes: 10 additions & 5 deletions tests/framework/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use crate::backends::{TestLogBackend, TestNavigatorBackend, TestUiBackend};
use crate::environment::RenderInterface;
use crate::fs_commands::{FsCommand, TestFsCommandProvider};
use crate::image_trigger::ImageTrigger;
use crate::options::image_comparison::ImageComparison;
use crate::options::TestOptions;
use crate::options::image_comparison::ImageComparison;
use crate::runner::automation::perform_automated_event;
use crate::runner::image_test::capture_and_compare_image;
use crate::runner::trace::compare_trace_output;
use crate::test::Test;
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use ruffle_core::backend::navigator::NullExecutor;
use ruffle_core::limits::ExecutionLimit;
use ruffle_core::tag_utils::SwfMovie;
Expand All @@ -21,7 +21,7 @@ use ruffle_input_format::InputInjector;
use ruffle_render::backend::{RenderBackend, ViewportDimensions};
use ruffle_socket_format::SocketEvent;
use std::collections::HashMap;
use std::sync::{mpsc, Arc, Mutex};
use std::sync::{Arc, Mutex, mpsc};
use std::time::Duration;
use vfs::VfsPath;

Expand Down Expand Up @@ -196,7 +196,10 @@ impl TestRunner {
FsCommand::CaptureImage(name) => {
if let Some(image_comparison) = self.images.remove(&name) {
if image_comparison.trigger != ImageTrigger::FsCommand {
return Err(anyhow!("Encountered fscommand to capture and compare image '{name}', but the trigger was expected to be {:?}", image_comparison.trigger));
return Err(anyhow!(
"Encountered fscommand to capture and compare image '{name}', but the trigger was expected to be {:?}",
image_comparison.trigger
));
}
capture_and_compare_image(
&self.root_path,
Expand All @@ -207,7 +210,9 @@ impl TestRunner {
self.render_interface.as_deref(),
)?;
} else {
return Err(anyhow!("Encountered fscommand to capture and compare image '{name}', but no [image_comparison] was set up for this."));
return Err(anyhow!(
"Encountered fscommand to capture and compare image '{name}', but no [image_comparison] was set up for this."
));
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion tests/framework/src/runner/image_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ pub fn test(

any_check_executed = true;
if outliers <= max_outliers {
println!("{check_name} succeeded: {outliers} outliers found, max difference {max_difference}");
println!(
"{check_name} succeeded: {outliers} outliers found, max difference {max_difference}"
);
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/framework/src/runner/trace.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::options::TestOptions;
use anyhow::{anyhow, Error};
use anyhow::{Error, anyhow};
use pretty_assertions::Comparison;
use vfs::VfsPath;

Expand Down
4 changes: 2 additions & 2 deletions tests/framework/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::environment::Environment;
use crate::options::TestOptions;
use crate::runner::TestRunner;
use crate::util::read_bytes;
use anyhow::{anyhow, Result};
use ruffle_core::{tag_utils::SwfMovie, FontQuery, FontType};
use anyhow::{Result, anyhow};
use ruffle_core::{FontQuery, FontType, tag_utils::SwfMovie};
use ruffle_input_format::InputInjector;
use ruffle_socket_format::SocketEvent;
use vfs::VfsPath;
Expand Down
2 changes: 1 addition & 1 deletion tests/fs-tests-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ruffle_fs_tests_runner"
authors.workspace = true
edition.workspace = true
edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion tests/input-format/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ruffle_input_format"
authors.workspace = true
edition.workspace = true
edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion tests/mocket/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mocket"
authors.workspace = true
edition.workspace = true
edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion tests/socket-format/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ruffle_socket_format"
authors.workspace = true
edition.workspace = true
edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Environment for NativeEnvironment {
#[cfg(feature = "imgtests")]
mod renderer {
use image::RgbaImage;
use ruffle_render_wgpu::backend::{request_adapter_and_device, WgpuRenderBackend};
use ruffle_render_wgpu::backend::{WgpuRenderBackend, request_adapter_and_device};
use ruffle_render_wgpu::descriptors::Descriptors;
use ruffle_render_wgpu::target::TextureTarget;
use ruffle_render_wgpu::wgpu;
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/regression_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use ruffle_test_framework::runner::TestStatus;
use ruffle_test_framework::test::Test;
use ruffle_test_framework::vfs::VfsPath;
use std::borrow::Cow;
use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe};
use std::panic::{AssertUnwindSafe, catch_unwind, resume_unwind};
use std::path::PathBuf;
use std::thread::sleep;

Expand Down
2 changes: 1 addition & 1 deletion web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ruffle_web"
description = "Web (WASM) bindings to the Ruffle Flash player"
authors.workspace = true
edition.workspace = true
edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion web/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ruffle_web_common"
version.workspace = true
authors.workspace = true
edition.workspace = true
edition = "2024"
license.workspace = true

[lints]
Expand Down
6 changes: 3 additions & 3 deletions web/packages/extension/safari/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ruffle_web_safari"
description = "Native binary for the Safari Web Extension"
authors.workspace = true
edition.workspace = true
edition = "2024"
homepage.workspace = true
license.workspace = true
repository.workspace = true
Expand All @@ -12,5 +12,5 @@ publish = false # This crate is useless unless packaged into an appex bundle
[lints]
workspace = true

[dependencies]
objc = "0.2.7"
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6.3"
13 changes: 6 additions & 7 deletions web/packages/extension/safari/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
#[cfg(target_os = "macos")]
mod macos {
use objc::class;
use objc::declare::ClassDecl;
use objc::runtime::Protocol;
use objc2::class;
use objc2::runtime::{AnyProtocol, ClassBuilder};

pub fn extension_class() {
let mut ruffle = ClassDecl::new("RuffleWebExtension", class!(NSObject))
.expect("Couldn't allocate new ClassDecl");
let mut ruffle = ClassBuilder::new(c"RuffleWebExtension", class!(NSObject))
.expect("Couldn't allocate new class");

ruffle.add_protocol(
Protocol::get("NSExtensionRequestHandling")
AnyProtocol::get(c"NSExtensionRequestHandling")
.expect("Couldn't find NSExtensionRequestHandling"),
);

ruffle.register();
}

#[link(name = "Foundation", kind = "framework")]
extern "C" {
unsafe extern "C" {
/// Private function used as the entry point of all app extensions.
///
/// In Obj-C/Swift apps, a linker flag is used to set this as the entry
Expand Down
8 changes: 4 additions & 4 deletions web/src/audio.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use ruffle_core::backend::audio::{
swf, AudioBackend, AudioMixer, AudioMixerProxy, DecodeError, RegisterError, SoundHandle,
SoundInstanceHandle, SoundStreamInfo, SoundTransform,
AudioBackend, AudioMixer, AudioMixerProxy, DecodeError, RegisterError, SoundHandle,
SoundInstanceHandle, SoundStreamInfo, SoundTransform, swf,
};
use ruffle_core::impl_audio_mixer_backend;
use ruffle_web_common::JsResult;
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use std::sync::Arc;
use std::time::Duration;
use tracing_subscriber::layer::Layered;
use tracing_subscriber::Registry;
use tracing_subscriber::layer::Layered;
use tracing_wasm::WASMLayer;
use wasm_bindgen::prelude::*;
use web_sys::{AudioContext, AudioScheduledSourceNode};
Expand Down Expand Up @@ -257,7 +257,7 @@ impl Drop for Buffer {
}

#[wasm_bindgen(raw_module = "./ruffle-imports")]
extern "C" {
unsafe extern "C" {
// Imported JS method to copy interleaved audio data into an `AudioBuffer`.
#[wasm_bindgen(js_name = "copyToAudioBufferInterleaved")]
fn copy_to_audio_buffer_interleaved(
Expand Down
Loading
Loading