Skip to content

Commit

Permalink
Merge branch 'master' into add_zoom_to_android_webview
Browse files Browse the repository at this point in the history
* master:
  [ci.yaml] Main branch support (flutter#4440)
  [video_player] Initialize player when size and duration become available (flutter#4438)
  [webview_flutter] Implement zoom enabled for ios and android (flutter#4417)
  Partial revert of "upgraded usage of BinaryMessenger (flutter#4451)" (flutter#4453)
  • Loading branch information
NickalasB committed Oct 27, 2021
2 parents 7fd7879 + 34caa5f commit 6552a1c
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 179 deletions.
3 changes: 2 additions & 1 deletion .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
# for every commit.
#
# More information at:
# * https://github.com/flutter/cocoon/blob/master/CI_YAML.md
# * https://github.com/flutter/cocoon/blob/main/CI_YAML.md
enabled_branches:
- main
- master

platform_properties:
Expand Down
4 changes: 0 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@ task:
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- ./script/tool_runner.sh lint-android # must come after build-examples
stable_channel_conditional_script:
- if [[ "$CHANNEL" == "stable" ]]; then
- dart ./ci/stable_conditional.dart
- fi
native_unit_test_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
Expand Down
67 changes: 0 additions & 67 deletions ci/stable_conditional.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ public void startListening_registersChannel() {
methodCallHandler.startListening(messenger);

verify(messenger, times(1))
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null));
// FLUTTER_STABLE_CONDITIONAL_ELSE
// .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
// FLUTTER_STABLE_CONDITIONAL_ENDIF
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
}

@Test
Expand All @@ -71,15 +67,9 @@ public void startListening_unregistersExistingChannel() {
methodCallHandler.startListening(secondMessenger);

// Unregisters the first and then registers the second.
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null);
verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
verify(secondMessenger, times(1))
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null));
// FLUTTER_STABLE_CONDITIONAL_ELSE
// verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
// verify(secondMessenger, times(1))
// .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
// FLUTTER_STABLE_CONDITIONAL_ENDIF
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
}

@Test
Expand All @@ -89,11 +79,7 @@ public void stopListening_unregistersExistingChannel() {

methodCallHandler.stopListening();

// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null);
// FLUTTER_STABLE_CONDITIONAL_ELSE
// verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
// FLUTTER_STABLE_CONDITIONAL_ENDIF
verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
}

@Test
Expand All @@ -102,11 +88,7 @@ public void stopListening_doesNothingWhenUnset() {

methodCallHandler.stopListening();

// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null);
// FLUTTER_STABLE_CONDITIONAL_ELSE
// verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null);
// FLUTTER_STABLE_CONDITIONAL_ENDIF
verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import android.os.Handler;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.flutter.embedding.engine.systemchannels.PlatformChannel;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodCall;
Expand All @@ -32,15 +31,6 @@ public class DartMessengerTest {
private static class FakeBinaryMessenger implements BinaryMessenger {
private final List<ByteBuffer> sentMessages = new ArrayList<>();

// TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable.
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
@Override
public BinaryMessenger.TaskQueue makeBackgroundTaskQueue() {
return null;
}
// FLUTTER_STABLE_CONDITIONAL_ELSE
// FLUTTER_STABLE_CONDITIONAL_ENDIF

@Override
public void send(@NonNull String channel, ByteBuffer message) {
sentMessages.add(message);
Expand All @@ -51,17 +41,8 @@ public void send(@NonNull String channel, ByteBuffer message, BinaryReply callba
send(channel, message);
}

// TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable.
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
@Override
public void setMessageHandler(
@NonNull String channel,
BinaryMessageHandler handler,
@Nullable BinaryMessenger.TaskQueue taskQueue) {}
// FLUTTER_STABLE_CONDITIONAL_ELSE
// @Override
// public void setMessageHandler(@NonNull String channel, BinaryMessageHandler handler) {}
// FLUTTER_STABLE_CONDITIONAL_ENDIF
public void setMessageHandler(@NonNull String channel, BinaryMessageHandler handler) {}

List<ByteBuffer> getMessages() {
return new ArrayList<>(sentMessages);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ public class QuickActionsTest {
private static class TestBinaryMessenger implements BinaryMessenger {
public MethodCall lastMethodCall;

// TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable.
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
@Override
public BinaryMessenger.TaskQueue makeBackgroundTaskQueue() {
return null;
}
// FLUTTER_STABLE_CONDITIONAL_ELSE
// FLUTTER_STABLE_CONDITIONAL_ENDIF

@Override
public void send(@NonNull String channel, @Nullable ByteBuffer message) {
send(channel, message, null);
Expand All @@ -58,21 +49,10 @@ public void send(
}
}

// TODO(aaclarke): Remove when https://github.com/flutter/engine/pull/29147 is on stable.
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
@Override
public void setMessageHandler(
@NonNull String channel,
@Nullable BinaryMessageHandler handler,
@Nullable BinaryMessenger.TaskQueue taskQueue) {
public void setMessageHandler(@NonNull String channel, @Nullable BinaryMessageHandler handler) {
// Do nothing.
}
// FLUTTER_STABLE_CONDITIONAL_ELSE
// @Override
// public void setMessageHandler(
// @NonNull String channel,
// @Nullable BinaryMessageHandler handler) {}
// FLUTTER_STABLE_CONDITIONAL_ENDIF
}

static final int SUPPORTED_BUILD = 25;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ public void startListening_registersChannel() {
methodCallHandler.startListening(messenger);

verify(messenger, times(1))
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null));
// FLUTTER_STABLE_CONDITIONAL_ELSE
// .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
// FLUTTER_STABLE_CONDITIONAL_ENDIF
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
}

@Test
Expand All @@ -60,15 +56,9 @@ public void startListening_unregistersExistingChannel() {
methodCallHandler.startListening(secondMessenger);

// Unregisters the first and then registers the second.
// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null);
verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
verify(secondMessenger, times(1))
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class), eq(null));
// FLUTTER_STABLE_CONDITIONAL_ELSE
// verify(firstMessenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
// verify(secondMessenger, times(1))
// .setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
// FLUTTER_STABLE_CONDITIONAL_ENDIF
.setMessageHandler(eq(CHANNEL_NAME), any(BinaryMessageHandler.class));
}

@Test
Expand All @@ -78,11 +68,7 @@ public void stopListening_unregistersExistingChannel() {

methodCallHandler.stopListening();

// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null, null);
// FLUTTER_STABLE_CONDITIONAL_ELSE
// verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
// FLUTTER_STABLE_CONDITIONAL_ENDIF
verify(messenger, times(1)).setMessageHandler(CHANNEL_NAME, null);
}

@Test
Expand All @@ -91,11 +77,7 @@ public void stopListening_doesNothingWhenUnset() {

methodCallHandler.stopListening();

// FLUTTER_STABLE_CONDITIONAL_IF_NOT_STABLE
verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null, null);
// FLUTTER_STABLE_CONDITIONAL_ELSE
// verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null);
// FLUTTER_STABLE_CONDITIONAL_ENDIF
verify(messenger, never()).setMessageHandler(CHANNEL_NAME, null);
}

@Test
Expand Down
4 changes: 4 additions & 0 deletions packages/video_player/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.2.6

* Initialize player when size and duration become available on iOS

## 2.2.5

* Support to closed caption WebVTT format added.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -269,7 +269,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1100;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "The Flutter Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1100"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,46 @@ - (void)setUp {
[self.app launch];
}

- (void)testTabs {
- (void)testPlayVideo {
XCUIApplication* app = self.app;

XCUIElement* remoteTab = [app.otherElements
elementMatchingPredicate:[NSPredicate predicateWithFormat:@"selected == YES"]];
if (![remoteTab waitForExistenceWithTimeout:30.0]) {
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription);
XCTFail(@"Failed due to not able to find selected Remote tab");
}
XCTAssertTrue([remoteTab waitForExistenceWithTimeout:30.0]);
XCTAssertTrue([remoteTab.label containsString:@"Remote"]);

XCUIElement* playButton = app.staticTexts[@"Play"];
XCTAssertTrue([playButton waitForExistenceWithTimeout:30.0]);
[playButton tap];

XCUIElement* chirpClosedCaption = app.staticTexts[@"[ Birds chirping ]"];
XCTAssertTrue([chirpClosedCaption waitForExistenceWithTimeout:30.0]);

XCUIElement* buzzClosedCaption = app.staticTexts[@"[ Buzzing ]"];
XCTAssertTrue([buzzClosedCaption waitForExistenceWithTimeout:30.0]);

XCUIElement* playbackSpeed1x = app.staticTexts[@"Playback speed\n1.0x"];
XCTAssertTrue([playbackSpeed1x waitForExistenceWithTimeout:30.0]);
[playbackSpeed1x tap];

XCUIElement* playbackSpeed5xButton = app.buttons[@"5.0x"];
XCTAssertTrue([playbackSpeed5xButton waitForExistenceWithTimeout:30.0]);
[playbackSpeed5xButton tap];

XCUIElement* playbackSpeed5x = app.staticTexts[@"Playback speed\n5.0x"];
XCTAssertTrue([playbackSpeed5x waitForExistenceWithTimeout:30.0]);

// Cycle through tabs.
for (NSString* tabName in @[ @"Asset", @"List example" ]) {
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"label BEGINSWITH %@", tabName];
XCUIElement* unselectedTab = [app.staticTexts elementMatchingPredicate:predicate];
if (![unselectedTab waitForExistenceWithTimeout:30.0]) {
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription);
XCTFail(@"Failed due to not able to find unselected %@ tab", tabName);
}
XCTAssertTrue([unselectedTab waitForExistenceWithTimeout:30.0]);
XCTAssertFalse(unselectedTab.isSelected);
[unselectedTab tap];

XCUIElement* selectedTab = [app.otherElements
elementMatchingPredicate:[NSPredicate predicateWithFormat:@"label BEGINSWITH %@", tabName]];
if (![selectedTab waitForExistenceWithTimeout:30.0]) {
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription);
XCTFail(@"Failed due to not able to find selected %@ tab", tabName);
}
XCTAssertTrue([selectedTab waitForExistenceWithTimeout:30.0]);
XCTAssertTrue(selectedTab.isSelected);
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/video_player/video_player/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ class _ControlsOverlay extends StatelessWidget {
Icons.play_arrow,
color: Colors.white,
size: 100.0,
semanticLabel: 'Play',
),
),
),
Expand Down
Loading

0 comments on commit 6552a1c

Please sign in to comment.