forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Un-deprecated FlutterViewController's binaryMessenger. (flutter#9767)
Un-deprecated FlutterViewController's binaryMessenger. Leaving it as a valid convenience method and to help minimize a breaking change.
- Loading branch information
Showing
5 changed files
with
37 additions
and
10 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
26 changes: 26 additions & 0 deletions
26
shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.m
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,26 @@ | ||
// 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/ios/framework/Headers/FlutterViewController.h" | ||
|
||
@interface FlutterViewControllerTest : XCTestCase | ||
@end | ||
|
||
@implementation FlutterViewControllerTest | ||
|
||
- (void)testBinaryMessenger { | ||
id engine = OCMClassMock([FlutterEngine class]); | ||
FlutterViewController* vc = [[FlutterViewController alloc] initWithEngine:engine | ||
nibName:nil | ||
bundle:nil]; | ||
XCTAssertNotNil(vc); | ||
id messenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger)); | ||
OCMStub([engine binaryMessenger]).andReturn(messenger); | ||
XCTAssertEqual(vc.binaryMessenger, messenger); | ||
OCMVerify([engine binaryMessenger]); | ||
} | ||
|
||
@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