Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #import "ios/clean/chrome/browser/ui/root/root_container_view_controller.h" | |
| 6 | |
| 7 #import "ios/clean/chrome/browser/ui/animators/zoom_transition_delegate.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | |
| 9 #import "third_party/ocmock/OCMock/OCMock.h" | |
| 10 | |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
| 12 #error "This file requires ARC support." | |
| 13 #endif | |
| 14 | |
| 15 namespace { | |
| 16 | |
| 17 // Tests that RootContainerViewController conforms to ZoomTransitionDelegate. | |
| 18 TEST(RootContainerViewControllerTest, TestConformsToZoomTransitionDelegate) { | |
| 19 EXPECT_TRUE([RootContainerViewController | |
| 20 conformsToProtocol:@protocol(ZoomTransitionDelegate)]); | |
| 21 } | |
| 22 | |
| 23 // Tests that calls to |rectForZoomWithKey| are forwarded to the | |
| 24 // contentViewController. | |
| 25 TEST(RootContainerViewControllerTest, TestForwardingMethod) { | |
| 26 id contentViewController = OCMProtocolMock(@protocol(ZoomTransitionDelegate)); | |
| 27 RootContainerViewController* viewController = | |
| 28 [[RootContainerViewController alloc] init]; | |
| 29 viewController.contentViewController = contentViewController; | |
| 30 [viewController rectForZoomWithKey:nil inView:nil]; | |
| 31 [[contentViewController verify] rectForZoomWithKey:[OCMArg any] | |
| 32 inView:[OCMArg any]]; | |
| 33 } | |
| 34 | |
|
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.
| |
| 35 } // namespace | |
| OLD | NEW |