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
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Debug;
Expand All @@ -587,7 +587,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Release;
Expand All @@ -603,7 +603,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

does this version bump have any implication on developers?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this is only the plugin example app project, it's not code or an Xcode project a plugin consumer would run.

TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Profile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import Flutter
import Testing
import UIKit
import XCTest

@testable import pointer_interceptor_ios

class RunnerTests: XCTestCase {
func testNonDebugMode() {
@MainActor
Copy link
Member Author

@jmagman jmagman Jan 10, 2026

Choose a reason for hiding this comment

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

Note if you don't use @MainActor there will be a main thread checker error because the test won't run on the main thread:

Image
PointerInterceptorView.swift:12 UIView.initWithFrame: must be used from main thread only

Though the test still passed. I'm not sure how to make it an error instead of a warning, without converting the whole thing to a test plan (which seems overkill)

Copy link
Contributor

Choose a reason for hiding this comment

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

You can make this an error by enabling the strict concurrency mode in build settings.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, I'll play around with how to do that #10788

struct RunnerTests {
@Test(arguments: [
(false, UIColor.clear),
(true, UIColor(red: 1, green: 0, blue: 0, alpha: 0.5)),
Copy link
Contributor

Choose a reason for hiding this comment

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

convenient!

])
func debugMode(debug: Bool, expectedColor: UIColor) {
let view = PointerInterceptorView(
frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: false)
frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: debug)

let debugView = view.view()
XCTAssertTrue(debugView.backgroundColor == UIColor.clear)
}

func testDebugMode() {
let view = PointerInterceptorView(
frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: true)

let debugView = view.view()
XCTAssertTrue(debugView.backgroundColor == UIColor(red: 1, green: 0, blue: 0, alpha: 0.5))
#expect(debugView.backgroundColor == expectedColor)
}
}
Loading