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

Side by Side Diff: ios/chrome/browser/ui/elements/activity_overlay_coordinator_unittest.mm

Issue 2588713002: Upstream Chrome on iOS source code [4/11]. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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/chrome/browser/ui/elements/activity_overlay_coordinator.h"
6
7 #include "base/ios/weak_nsobject.h"
8 #include "base/test/ios/wait_util.h"
9 #import "ios/chrome/browser/ui/elements/activity_overlay_view_controller.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11 #import "testing/gtest_mac.h"
12
13 // Tests that invoking start and stop on the coordinator presents and dismisses
14 // the activity overlay view, respectively.
15 TEST(ActivityOverlayCoordinatorTest, StartAndStop) {
16 base::WeakNSObject<UIView> overlay_view;
17 @autoreleasepool {
18 UIViewController* base_view_controller =
19 [[[UIViewController alloc] init] autorelease];
20 ActivityOverlayCoordinator* coordinator =
21 [[[ActivityOverlayCoordinator alloc]
22 initWithBaseViewController:base_view_controller] autorelease];
23
24 EXPECT_EQ(0u, [base_view_controller.childViewControllers count]);
25
26 [coordinator start];
27 EXPECT_EQ(1u, [base_view_controller.childViewControllers count]);
28 overlay_view.reset(
29 [base_view_controller.childViewControllers firstObject].view);
30 EXPECT_TRUE(
31 [[base_view_controller.view subviews] containsObject:overlay_view]);
32
33 [coordinator stop];
34 EXPECT_EQ(0u, [base_view_controller.childViewControllers count]);
35 }
36 EXPECT_FALSE(overlay_view.get());
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698