Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/root/root_container_view_controller_unittest.mm |
| diff --git a/ios/clean/chrome/browser/ui/root/root_container_view_controller_unittest.mm b/ios/clean/chrome/browser/ui/root/root_container_view_controller_unittest.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..af899cee27159c6c70cc95a18d551a215287c0f3 |
| --- /dev/null |
| +++ b/ios/clean/chrome/browser/ui/root/root_container_view_controller_unittest.mm |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2017 The Chromium 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 "ios/clean/chrome/browser/ui/root/root_container_view_controller.h" |
| + |
| +#import "ios/clean/chrome/browser/ui/animators/zoom_transition_delegate.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| +#import "third_party/ocmock/OCMock/OCMock.h" |
| + |
| +#if !defined(__has_feature) || !__has_feature(objc_arc) |
| +#error "This file requires ARC support." |
| +#endif |
| + |
| +namespace { |
| + |
| +// Tests that RootContainerViewController conforms to ZoomTransitionDelegate. |
| +TEST(RootContainerViewControllerTest, TestConformsToZoomTransitionDelegate) { |
| + EXPECT_TRUE([RootContainerViewController |
| + conformsToProtocol:@protocol(ZoomTransitionDelegate)]); |
| +} |
| + |
| +// Tests that calls to |rectForZoomWithKey| are forwarded to the |
| +// contentViewController. |
| +TEST(RootContainerViewControllerTest, TestForwardingMethod) { |
| + id contentViewController = OCMProtocolMock(@protocol(ZoomTransitionDelegate)); |
| + RootContainerViewController* viewController = |
| + [[RootContainerViewController alloc] init]; |
| + viewController.contentViewController = contentViewController; |
| + [viewController rectForZoomWithKey:nil inView:nil]; |
| + [[contentViewController verify] rectForZoomWithKey:[OCMArg any] |
| + inView:[OCMArg any]]; |
| +} |
| + |
|
lpromero
2017/04/12 08:58:49
Could you add a test for the switching of contentV
edchin
2017/04/13 07:39:15
Done.
|
| +} // namespace |