-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix _availability_version_check for iOS 11 and 12
- Loading branch information
Showing
8 changed files
with
233 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// 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 <cstdint> | ||
#include <optional> | ||
|
||
namespace flutter { | ||
|
||
struct ProductVersion { | ||
ProductVersion() = default; | ||
ProductVersion(int32_t major, int32_t minor, int32_t subminor) | ||
: major(major), minor(minor), subminor(subminor) {} | ||
|
||
int32_t major; | ||
int32_t minor; | ||
int32_t subminor; | ||
}; | ||
|
||
std::optional<ProductVersion> ProductVersionFromSystemVersionPList(); | ||
|
||
} // namespace flutter |
15 changes: 15 additions & 0 deletions
15
shell/platform/darwin/common/availability_version_check_unittests.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// 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/shell/platform/darwin/common/availability_version_check.h" | ||
|
||
#include "gtest/gtest.h" | ||
|
||
TEST(AvailabilityVersionCheck, CanDecodeSystemPlist) { | ||
auto product_version = flutter::ProductVersionFromSystemVersionPList(); | ||
ASSERT_TRUE(product_version.has_value()); | ||
if (product_version.has_value()) { | ||
ASSERT_GT(product_version.value().major, 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
shell/platform/darwin/ios/framework/Source/availability_version_check_test.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// 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. | ||
|
||
#import <OCMock/OCMock.h> | ||
#import <XCTest/XCTest.h> | ||
|
||
#import "flutter/shell/platform/darwin/common/availability_version_check.h" | ||
|
||
@interface AvailabilityVersionCheckTest : XCTestCase | ||
@end | ||
|
||
@implementation AvailabilityVersionCheckTest | ||
|
||
- (void)testSimple { | ||
auto product_version = flutter::ProductVersionFromSystemVersionPList(); | ||
XCTAssertTrue(product_version.has_value()); | ||
if (product_version.has_value()) { | ||
XCTAssertTrue(product_version.value().major > 0); | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters