diff --git a/BUILD.gn b/BUILD.gn index 4eb42dfa45070..c5be744c10642 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -186,7 +186,6 @@ group("unittests") { "//flutter/display_list:display_list_rendertests", "//flutter/display_list:display_list_unittests", "//flutter/flow:flow_unittests", - "//flutter/fml:fml_arc_unittests", "//flutter/fml:fml_unittests", "//flutter/lib/ui:ui_unittests", "//flutter/runtime:dart_plugin_registrant_unittests", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6871fbd71d1c9..21c0372adf0cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -256,7 +256,6 @@ $ ./run_tests.py --variant=host_debug_unopt_arm64 --type=engine | felt | n/a | The test runner for flutter web. See //lib/web_ui | | flow_unittests | engine | | | flutter_tester | dart | Launcher for engine dart tests. | -| fml_arc_unittests | engine | | | fml_unittests | engine | Unit tests for //fml | | framework_common_unittests | engine(mac) | | | gpu_surface_metal_unittests | engine(mac) | | diff --git a/ci/licenses_golden/excluded_files b/ci/licenses_golden/excluded_files index 5dd3c7cacc24d..5108bd49e8b77 100644 --- a/ci/licenses_golden/excluded_files +++ b/ci/licenses_golden/excluded_files @@ -107,8 +107,6 @@ ../../../flutter/fml/message_loop_unittests.cc ../../../flutter/fml/paths_unittests.cc ../../../flutter/fml/platform/darwin/cf_utils_unittests.mm -../../../flutter/fml/platform/darwin/scoped_nsobject_arc_unittests.mm -../../../flutter/fml/platform/darwin/scoped_nsobject_unittests.mm ../../../flutter/fml/platform/darwin/string_range_sanitization_unittests.mm ../../../flutter/fml/platform/fuchsia/log_interest_listener_unittests.cc ../../../flutter/fml/platform/win/file_win_unittests.cc diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index 0d59b572d55e7..53d58cda25c30 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -42733,8 +42733,6 @@ ORIGIN: ../../../flutter/fml/platform/darwin/scoped_block.h + ../../../flutter/L ORIGIN: ../../../flutter/fml/platform/darwin/scoped_block.mm + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/platform/darwin/scoped_nsautorelease_pool.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/platform/darwin/scoped_nsautorelease_pool.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/fml/platform/darwin/scoped_nsobject.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/fml/platform/darwin/scoped_nsobject.mm + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/platform/darwin/scoped_policy.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/platform/darwin/scoped_typeref.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/platform/darwin/string_range_sanitization.h + ../../../flutter/LICENSE @@ -45597,8 +45595,6 @@ FILE: ../../../flutter/fml/platform/darwin/scoped_block.h FILE: ../../../flutter/fml/platform/darwin/scoped_block.mm FILE: ../../../flutter/fml/platform/darwin/scoped_nsautorelease_pool.cc FILE: ../../../flutter/fml/platform/darwin/scoped_nsautorelease_pool.h -FILE: ../../../flutter/fml/platform/darwin/scoped_nsobject.h -FILE: ../../../flutter/fml/platform/darwin/scoped_nsobject.mm FILE: ../../../flutter/fml/platform/darwin/scoped_policy.h FILE: ../../../flutter/fml/platform/darwin/scoped_typeref.h FILE: ../../../flutter/fml/platform/darwin/string_range_sanitization.h diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 182989d8845cb..0b1ff30be0851 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -156,8 +156,6 @@ source_set("fml") { "platform/darwin/scoped_block.mm", "platform/darwin/scoped_nsautorelease_pool.cc", "platform/darwin/scoped_nsautorelease_pool.h", - "platform/darwin/scoped_nsobject.h", - "platform/darwin/scoped_nsobject.mm", "platform/darwin/scoped_policy.h", "platform/darwin/scoped_typeref.h", "platform/darwin/string_range_sanitization.h", @@ -374,10 +372,6 @@ if (enable_unittests) { ] } - if (is_mac || is_ios) { - sources += [ "platform/darwin/scoped_nsobject_unittests.mm" ] - } - if (is_fuchsia) { sources += [ "platform/fuchsia/log_interest_listener_unittests.cc" ] } @@ -408,18 +402,4 @@ if (enable_unittests) { libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] } } - - executable("fml_arc_unittests") { - testonly = true - if (is_mac || is_ios) { - cflags_objcc = flutter_cflags_objc_arc - sources = [ "platform/darwin/scoped_nsobject_arc_unittests.mm" ] - } - - deps = [ - ":fml_fixtures", - "//flutter/fml", - "//flutter/testing", - ] - } } diff --git a/fml/platform/darwin/scoped_nsobject.h b/fml/platform/darwin/scoped_nsobject.h deleted file mode 100644 index b6540c4a94a0d..0000000000000 --- a/fml/platform/darwin/scoped_nsobject.h +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_FML_PLATFORM_DARWIN_SCOPED_NSOBJECT_H_ -#define FLUTTER_FML_PLATFORM_DARWIN_SCOPED_NSOBJECT_H_ - -#include -#include - -// Include NSObject.h directly because Foundation.h pulls in many dependencies. -// (Approx 100k lines of code versus 1.5k for NSObject.h). scoped_nsobject gets -// singled out because it is most typically included from other header files. -#import - -#include "flutter/fml/macros.h" -#include "flutter/fml/platform/darwin/scoped_typeref.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -@class NSAutoreleasePool; -#endif - -namespace fml { - -// scoped_nsobject<> is patterned after scoped_ptr<>, but maintains ownership -// of an NSObject subclass object. Style deviations here are solely for -// compatibility with scoped_ptr<>'s interface, with which everyone is already -// familiar. -// -// scoped_nsobject<> takes ownership of an object (in the constructor or in -// reset()) by taking over the caller's existing ownership claim. The caller -// must own the object it gives to scoped_nsobject<>, and relinquishes an -// ownership claim to that object. scoped_nsobject<> does not call -retain, -// callers have to call this manually if appropriate. -// -// scoped_nsprotocol<> has the same behavior as scoped_nsobject, but can be used -// with protocols. -// -// scoped_nsobject<> is not to be used for NSAutoreleasePools. For -// NSAutoreleasePools use ScopedNSAutoreleasePool from -// scoped_nsautorelease_pool.h instead. -// We check for bad uses of scoped_nsobject and NSAutoreleasePool at compile -// time with a template specialization (see below). -// -// If Automatic Reference Counting (aka ARC) is enabled then the ownership -// policy is not controllable by the user as ARC make it really difficult to -// transfer ownership (the reference passed to scoped_nsobject constructor is -// sunk by ARC and __attribute((ns_consumed)) appears to not work correctly -// with Objective-C++ see https://llvm.org/bugs/show_bug.cgi?id=27887). Due to -// that, the policy is always to |RETAIN| when using ARC. - -namespace internal { - -id ScopedNSProtocolTraitsRetain(__unsafe_unretained id obj) - __attribute((ns_returns_not_retained)); -id ScopedNSProtocolTraitsAutoRelease(__unsafe_unretained id obj) - __attribute((ns_returns_not_retained)); -void ScopedNSProtocolTraitsRelease(__unsafe_unretained id obj); - -// Traits for ScopedTypeRef<>. As this class may be compiled from file with -// Automatic Reference Counting enable or not all methods have annotation to -// enforce the same code generation in both case (in particular, the Retain -// method uses ns_returns_not_retained to prevent ARC to insert a -release -// call on the returned value and thus defeating the -retain). -template -struct ScopedNSProtocolTraits { - static NST InvalidValue() __attribute((ns_returns_not_retained)) { - return nil; - } - static NST Retain(__unsafe_unretained NST nst) - __attribute((ns_returns_not_retained)) { - return ScopedNSProtocolTraitsRetain(nst); - } - static void Release(__unsafe_unretained NST nst) { - ScopedNSProtocolTraitsRelease(nst); - } -}; - -} // namespace internal - -template -class scoped_nsprotocol - : public ScopedTypeRef> { - public: - using Traits = internal::ScopedNSProtocolTraits; - -#if !defined(__has_feature) || !__has_feature(objc_arc) - explicit scoped_nsprotocol(NST object = Traits::InvalidValue(), - scoped_policy::OwnershipPolicy policy = - scoped_policy::OwnershipPolicy::kAssume) - : ScopedTypeRef(object, policy) {} -#else - explicit scoped_nsprotocol(NST object = Traits::InvalidValue()) - : ScopedTypeRef(object, - scoped_policy::OwnershipPolicy::kRetain) {} -#endif - - // NOLINTNEXTLINE(google-explicit-constructor) - scoped_nsprotocol(const scoped_nsprotocol& that) - : ScopedTypeRef(that) {} - - template - explicit scoped_nsprotocol(const scoped_nsprotocol& that_as_subclass) - : ScopedTypeRef(that_as_subclass) {} - - // NOLINTNEXTLINE(google-explicit-constructor) - scoped_nsprotocol(scoped_nsprotocol&& that) - : ScopedTypeRef(std::move(that)) {} - - scoped_nsprotocol& operator=(const scoped_nsprotocol& that) { - ScopedTypeRef::operator=(that); - return *this; - } - -#if !defined(__has_feature) || !__has_feature(objc_arc) - void reset(NST object = Traits::InvalidValue(), - scoped_policy::OwnershipPolicy policy = - scoped_policy::OwnershipPolicy::kAssume) { - ScopedTypeRef::reset(object, policy); - } -#else - void reset(NST object = Traits::InvalidValue()) { - ScopedTypeRef::reset(object, - scoped_policy::OwnershipPolicy::kRetain); - } -#endif - - // Shift reference to the autorelease pool to be released later. - NST autorelease() __attribute((ns_returns_not_retained)) { - return internal::ScopedNSProtocolTraitsAutoRelease(this->release()); - } -}; - -// Free functions -template -void swap(scoped_nsprotocol& p1, scoped_nsprotocol& p2) { - p1.swap(p2); -} - -template -bool operator==(C p1, const scoped_nsprotocol& p2) { - return p1 == p2.get(); -} - -template -bool operator!=(C p1, const scoped_nsprotocol& p2) { - return p1 != p2.get(); -} - -template -class scoped_nsobject : public scoped_nsprotocol { - public: - using Traits = typename scoped_nsprotocol::Traits; - -#if !defined(__has_feature) || !__has_feature(objc_arc) - explicit scoped_nsobject(NST* object = Traits::InvalidValue(), - scoped_policy::OwnershipPolicy policy = - scoped_policy::OwnershipPolicy::kAssume) - : scoped_nsprotocol(object, policy) {} -#else - explicit scoped_nsobject(NST* object = Traits::InvalidValue()) - : scoped_nsprotocol(object) {} -#endif - - // NOLINTNEXTLINE(google-explicit-constructor) - scoped_nsobject(const scoped_nsobject& that) - : scoped_nsprotocol(that) {} - - template - explicit scoped_nsobject(const scoped_nsobject& that_as_subclass) - : scoped_nsprotocol(that_as_subclass) {} - - // NOLINTNEXTLINE(google-explicit-constructor) - scoped_nsobject(scoped_nsobject&& that) - : scoped_nsprotocol(std::move(that)) {} - - scoped_nsobject& operator=(const scoped_nsobject& that) { - scoped_nsprotocol::operator=(that); - return *this; - } - -#if !defined(__has_feature) || !__has_feature(objc_arc) - void reset(NST* object = Traits::InvalidValue(), - scoped_policy::OwnershipPolicy policy = - scoped_policy::OwnershipPolicy::kAssume) { - scoped_nsprotocol::reset(object, policy); - } -#else - void reset(NST* object = Traits::InvalidValue()) { - scoped_nsprotocol::reset(object); - } -#endif - -#if !defined(__has_feature) || !__has_feature(objc_arc) - static_assert(std::is_same::value == false, - "Use ScopedNSAutoreleasePool instead"); -#endif -}; - -// Specialization to make scoped_nsobject work. -template <> -class scoped_nsobject : public scoped_nsprotocol { - public: - using Traits = typename scoped_nsprotocol::Traits; - -#if !defined(__has_feature) || !__has_feature(objc_arc) - explicit scoped_nsobject(id object = Traits::InvalidValue(), - scoped_policy::OwnershipPolicy policy = - scoped_policy::OwnershipPolicy::kAssume) - : scoped_nsprotocol(object, policy) {} -#else - explicit scoped_nsobject(id object = Traits::InvalidValue()) - : scoped_nsprotocol(object) {} -#endif - - // NOLINTNEXTLINE(google-explicit-constructor) - scoped_nsobject(const scoped_nsobject& that) - : scoped_nsprotocol(that) {} - - template - explicit scoped_nsobject(const scoped_nsobject& that_as_subclass) - : scoped_nsprotocol(that_as_subclass) {} - - // NOLINTNEXTLINE(google-explicit-constructor) - scoped_nsobject(scoped_nsobject&& that) - : scoped_nsprotocol(std::move(that)) {} - - scoped_nsobject& operator=(const scoped_nsobject& that) { - scoped_nsprotocol::operator=(that); - return *this; - } - -#if !defined(__has_feature) || !__has_feature(objc_arc) - void reset(id object = Traits::InvalidValue(), - scoped_policy::OwnershipPolicy policy = - scoped_policy::OwnershipPolicy::kAssume) { - scoped_nsprotocol::reset(object, policy); - } -#else - void reset(id object = Traits::InvalidValue()) { - scoped_nsprotocol::reset(object); - } -#endif -}; - -} // namespace fml - -#endif // FLUTTER_FML_PLATFORM_DARWIN_SCOPED_NSOBJECT_H_ diff --git a/fml/platform/darwin/scoped_nsobject.mm b/fml/platform/darwin/scoped_nsobject.mm deleted file mode 100644 index 0645420b32df4..0000000000000 --- a/fml/platform/darwin/scoped_nsobject.mm +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "flutter/fml/platform/darwin/scoped_nsobject.h" - -namespace fml { - -namespace internal { - -id ScopedNSProtocolTraitsRetain(id obj) { - return [obj retain]; -} - -id ScopedNSProtocolTraitsAutoRelease(id obj) { - return [obj autorelease]; -} - -void ScopedNSProtocolTraitsRelease(id obj) { - return [obj release]; -} - -} // namespace internal -} // namespace fml diff --git a/fml/platform/darwin/scoped_nsobject_arc_unittests.mm b/fml/platform/darwin/scoped_nsobject_arc_unittests.mm deleted file mode 100644 index cde666a00f354..0000000000000 --- a/fml/platform/darwin/scoped_nsobject_arc_unittests.mm +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include - -#import - -#include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "fml/logging.h" -#include "gtest/gtest.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -template -CFIndex GetRetainCount(const fml::scoped_nsobject& nst) { - @autoreleasepool { - return CFGetRetainCount((__bridge CFTypeRef)nst.get()) - 1; - } -} - -#if __has_feature(objc_arc_weak) -TEST(ScopedNSObjectTestARC, DefaultPolicyIsRetain) { - __weak id o; - @autoreleasepool { - fml::scoped_nsprotocol p([[NSObject alloc] init]); - o = p.get(); - EXPECT_EQ(o, p.get()); - } - EXPECT_EQ(o, nil); -} -#endif - -TEST(ScopedNSObjectTestARC, ScopedNSObject) { - fml::scoped_nsobject p1([[NSObject alloc] init]); - @autoreleasepool { - EXPECT_TRUE(p1.get()); - EXPECT_TRUE(p1.get()); - } - EXPECT_EQ(1, GetRetainCount(p1)); - EXPECT_EQ(1, GetRetainCount(p1)); - fml::scoped_nsobject p2(p1); - @autoreleasepool { - EXPECT_EQ(p1.get(), p2.get()); - } - EXPECT_EQ(2, GetRetainCount(p1)); - p2.reset(); - EXPECT_EQ(nil, p2.get()); - EXPECT_EQ(1, GetRetainCount(p1)); - { - fml::scoped_nsobject p3 = p1; - @autoreleasepool { - EXPECT_EQ(p1.get(), p3.get()); - } - EXPECT_EQ(2, GetRetainCount(p1)); - p3 = p1; - @autoreleasepool { - EXPECT_EQ(p1.get(), p3.get()); - } - EXPECT_EQ(2, GetRetainCount(p1)); - } - EXPECT_EQ(1, GetRetainCount(p1)); - fml::scoped_nsobject p4; - @autoreleasepool { - p4 = fml::scoped_nsobject(p1.get()); - } - EXPECT_EQ(2, GetRetainCount(p1)); - @autoreleasepool { - EXPECT_TRUE(p1 == p1.get()); - EXPECT_TRUE(p1 == p1); - EXPECT_FALSE(p1 != p1); - EXPECT_FALSE(p1 != p1.get()); - } - fml::scoped_nsobject p5([[NSObject alloc] init]); - @autoreleasepool { - EXPECT_TRUE(p1 != p5); - EXPECT_TRUE(p1 != p5.get()); - EXPECT_FALSE(p1 == p5); - EXPECT_FALSE(p1 == p5.get()); - } - - fml::scoped_nsobject p6 = p1; - EXPECT_EQ(3, GetRetainCount(p6)); - @autoreleasepool { - p6.autorelease(); - EXPECT_EQ(nil, p6.get()); - } - EXPECT_EQ(2, GetRetainCount(p1)); -} - -TEST(ScopedNSObjectTestARC, ScopedNSObjectInContainer) { - fml::scoped_nsobject p([[NSObject alloc] init]); - @autoreleasepool { - EXPECT_TRUE(p.get()); - } - EXPECT_EQ(1, GetRetainCount(p)); - @autoreleasepool { - std::vector> objects; - objects.push_back(p); - EXPECT_EQ(2, GetRetainCount(p)); - @autoreleasepool { - EXPECT_EQ(p.get(), objects[0].get()); - } - objects.push_back(fml::scoped_nsobject([[NSObject alloc] init])); - @autoreleasepool { - EXPECT_TRUE(objects[1].get()); - } - EXPECT_EQ(1, GetRetainCount(objects[1])); - } - EXPECT_EQ(1, GetRetainCount(p)); -} - -TEST(ScopedNSObjectTestARC, ScopedNSObjectFreeFunctions) { - fml::scoped_nsobject p1([[NSObject alloc] init]); - id o1 = p1.get(); - EXPECT_TRUE(o1 == p1); - EXPECT_FALSE(o1 != p1); - fml::scoped_nsobject p2([[NSObject alloc] init]); - EXPECT_TRUE(o1 != p2); - EXPECT_FALSE(o1 == p2); - id o2 = p2.get(); - swap(p1, p2); - EXPECT_EQ(o2, p1.get()); - EXPECT_EQ(o1, p2.get()); -} - -} // namespace diff --git a/fml/platform/darwin/scoped_nsobject_unittests.mm b/fml/platform/darwin/scoped_nsobject_unittests.mm deleted file mode 100644 index 566fcfd988923..0000000000000 --- a/fml/platform/darwin/scoped_nsobject_unittests.mm +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include - -#include "flutter/fml/platform/darwin/scoped_nsautorelease_pool.h" -#include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "gtest/gtest.h" - -namespace { - -// This is to suppress the bugprone-use-after-move warning. -// This strategy is recommanded here: -// https://clang.llvm.org/extra/clang-tidy/checks/bugprone/use-after-move.html#silencing-erroneous-warnings -template -void IS_INITIALIZED(T&) {} - -TEST(ScopedNSObjectTest, ScopedNSObject) { - fml::scoped_nsobject p1([[NSObject alloc] init]); - ASSERT_TRUE(p1.get()); - ASSERT_EQ(1u, [p1 retainCount]); - fml::scoped_nsobject p2(p1); - ASSERT_EQ(p1.get(), p2.get()); - ASSERT_EQ(2u, [p1 retainCount]); - p2.reset(); - ASSERT_EQ(nil, p2.get()); - ASSERT_EQ(1u, [p1 retainCount]); - { - fml::scoped_nsobject p3 = p1; - ASSERT_EQ(p1.get(), p3.get()); - ASSERT_EQ(2u, [p1 retainCount]); - p3 = p1; - ASSERT_EQ(p1.get(), p3.get()); - ASSERT_EQ(2u, [p1 retainCount]); - } - ASSERT_EQ(1u, [p1 retainCount]); - fml::scoped_nsobject p4([p1.get() retain]); - ASSERT_EQ(2u, [p1 retainCount]); - ASSERT_TRUE(p1 == p1.get()); - ASSERT_TRUE(p1 == p1); - ASSERT_FALSE(p1 != p1); - ASSERT_FALSE(p1 != p1.get()); - fml::scoped_nsobject p5([[NSObject alloc] init]); - ASSERT_TRUE(p1 != p5); - ASSERT_TRUE(p1 != p5.get()); - ASSERT_FALSE(p1 == p5); - ASSERT_FALSE(p1 == p5.get()); - - fml::scoped_nsobject p6 = p1; - ASSERT_EQ(3u, [p6 retainCount]); - { - fml::ScopedNSAutoreleasePool pool; - p6.autorelease(); - ASSERT_EQ(nil, p6.get()); - ASSERT_EQ(3u, [p1 retainCount]); - } - ASSERT_EQ(2u, [p1 retainCount]); - - fml::scoped_nsobject p7([[NSObject alloc] init]); - fml::scoped_nsobject p8(std::move(p7)); - ASSERT_TRUE(p8); - ASSERT_EQ(1u, [p8 retainCount]); - IS_INITIALIZED(p7); - ASSERT_FALSE(p7.get()); -} - -// Instantiating scoped_nsobject<> with T=NSAutoreleasePool should trip a -// static_assert. -#if 0 -TEST(ScopedNSObjectTest, FailToCreateScopedNSObjectAutoreleasePool) { - fml::scoped_nsobject pool; -} -#endif - -TEST(ScopedNSObjectTest, ScopedNSObjectInContainer) { - fml::scoped_nsobject p([[NSObject alloc] init]); - ASSERT_TRUE(p.get()); - ASSERT_EQ(1u, [p retainCount]); - { - std::vector> objects; - objects.push_back(p); - ASSERT_EQ(2u, [p retainCount]); - ASSERT_EQ(p.get(), objects[0].get()); - objects.push_back(fml::scoped_nsobject([[NSObject alloc] init])); - ASSERT_TRUE(objects[1].get()); - ASSERT_EQ(1u, [objects[1] retainCount]); - } - ASSERT_EQ(1u, [p retainCount]); -} - -TEST(ScopedNSObjectTest, ScopedNSObjectFreeFunctions) { - fml::scoped_nsobject p1([[NSObject alloc] init]); - id o1 = p1.get(); - ASSERT_TRUE(o1 == p1); - ASSERT_FALSE(o1 != p1); - fml::scoped_nsobject p2([[NSObject alloc] init]); - ASSERT_TRUE(o1 != p2); - ASSERT_FALSE(o1 == p2); - id o2 = p2.get(); - swap(p1, p2); - ASSERT_EQ(o2, p1.get()); - ASSERT_EQ(o1, p2.get()); -} - -} // namespace diff --git a/testing/run_tests.py b/testing/run_tests.py index bac49efb53609..c25f862591a4f 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -429,7 +429,6 @@ def make_test(name, flags=None, extra_env=None): make_test('embedder_proctable_unittests'), make_test('embedder_unittests'), make_test('fml_unittests'), - make_test('fml_arc_unittests'), make_test('no_dart_plugin_registrant_unittests'), make_test('runtime_unittests'), make_test('tonic_unittests'), diff --git a/tools/engine_tool/test/commands/build_command_test.dart b/tools/engine_tool/test/commands/build_command_test.dart index 243e75a46e084..e21cc9dabd021 100644 --- a/tools/engine_tool/test/commands/build_command_test.dart +++ b/tools/engine_tool/test/commands/build_command_test.dart @@ -442,9 +442,9 @@ void main() { CannedProcess( (command) => command.contains('desc'), stdout: convert.jsonEncode({ - '//flutter/fml:fml_arc_unittests': { + '//flutter/fml:fml_unittests': { 'outputs': [ - '//out/host_debug/fml_arc_unittests', + '//out/host_debug/fml_unittests', ], 'testonly': true, 'type': 'executable', @@ -473,7 +473,7 @@ void main() { 'build', '--config', 'ci/host_debug', - '//flutter/fml:fml_arc_unittests', + '//flutter/fml:fml_unittests', ]); printOnFailure(testEnv.testLogs.map((r) => r.message).join('\n')); @@ -495,7 +495,7 @@ void main() { expect( ninjaCmd.command, contains( - contains('flutter/fml:fml_arc_unittests'), + contains('flutter/fml:fml_unittests'), ), ); }); @@ -521,9 +521,9 @@ void main() { 'testonly': true, 'type': 'executable', }, - '//flutter/fml:fml_arc_unittests': { + '//flutter/fml:fml_unittests': { 'outputs': [ - '//out/host_debug/fml_arc_unittests', + '//out/host_debug/fml_unittests', ], 'testonly': true, 'type': 'executable', @@ -576,7 +576,7 @@ void main() { containsAll([ 'flutter/display_list:display_list_unittests', 'flutter/flow:flow_unittests', - 'flutter/fml:fml_arc_unittests', + 'flutter/fml:fml_unittests', ]), ); }); diff --git a/tools/engine_tool/test/commands/query_command_test.dart b/tools/engine_tool/test/commands/query_command_test.dart index 77edae6f36864..04b41c92996f8 100644 --- a/tools/engine_tool/test/commands/query_command_test.dart +++ b/tools/engine_tool/test/commands/query_command_test.dart @@ -320,9 +320,9 @@ void main() { 'testonly': true, 'type': 'executable', }, - '//flutter/fml:fml_arc_unittests': { + '//flutter/fml:fml_unittests': { 'outputs': [ - '//out/host_debug/fml_arc_unittests', + '//out/host_debug/fml_unittests', ], 'testonly': true, 'type': 'executable', @@ -374,7 +374,7 @@ void main() { final expected = [ '//flutter/display_list:display_list_unittests', '//flutter/flow:flow_unittest', - '//flutter/fml:fml_arc_unittests', + '//flutter/fml:fml_unittests', ]; final testLogs = stringsFromLogs(testEnvironment.testLogs);