Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: ios/clean/chrome/browser/ui/root/root_container_view_controller_unittest.mm

Issue 2800313002: [ios] RootCoordinator and view controller. (Closed)
Patch Set: Unittests, showcase, and clean up. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698