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

Side by Side Diff: ios/chrome/app/application_delegate/url_opener_unittest.mm

Issue 2930363003: Revert "[ios] Ensure proper shutdown of Chrome on iOS." (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/chrome/app/main_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/chrome/app/application_delegate/url_opener.h" 5 #include "ios/chrome/app/application_delegate/url_opener.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "ios/chrome/app/application_delegate/app_state.h" 9 #include "ios/chrome/app/application_delegate/app_state.h"
10 #include "ios/chrome/app/application_delegate/app_state_testing.h" 10 #include "ios/chrome/app/application_delegate/app_state_testing.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 @property(nonatomic, assign) GURL tabURL; 70 @property(nonatomic, assign) GURL tabURL;
71 @property(nonatomic, assign) NSUInteger position; 71 @property(nonatomic, assign) NSUInteger position;
72 @property(nonatomic, assign) ui::PageTransition transition; 72 @property(nonatomic, assign) ui::PageTransition transition;
73 73
74 - (Tab*)addSelectedTabWithURL:(const GURL&)url 74 - (Tab*)addSelectedTabWithURL:(const GURL&)url
75 atIndex:(NSUInteger)position 75 atIndex:(NSUInteger)position
76 transition:(ui::PageTransition)transition; 76 transition:(ui::PageTransition)transition;
77 - (void)expectNewForegroundTab; 77 - (void)expectNewForegroundTab;
78 - (void)setActive:(BOOL)active; 78 - (void)setActive:(BOOL)active;
79 - (TabModel*)tabModel; 79 - (TabModel*)tabModel;
80 - (void)shutdown;
81 @end 80 @end
82 81
83 @implementation URLOpenerMockBVC 82 @implementation URLOpenerMockBVC
84 @synthesize browserState = _browserState; 83 @synthesize browserState = _browserState;
85 @synthesize tabURL = _tabURL; 84 @synthesize tabURL = _tabURL;
86 @synthesize position = _position; 85 @synthesize position = _position;
87 @synthesize transition = _transition; 86 @synthesize transition = _transition;
88 87
89 - (Tab*)addSelectedTabWithURL:(const GURL&)url 88 - (Tab*)addSelectedTabWithURL:(const GURL&)url
90 atIndex:(NSUInteger)position 89 atIndex:(NSUInteger)position
(...skipping 13 matching lines...) Expand all
104 } 103 }
105 104
106 - (void)setPrimary:(BOOL)primary { 105 - (void)setPrimary:(BOOL)primary {
107 // no-op 106 // no-op
108 } 107 }
109 108
110 - (TabModel*)tabModel { 109 - (TabModel*)tabModel {
111 return nil; 110 return nil;
112 } 111 }
113 112
114 - (void)shutdown {
115 // no-op
116 }
117
118 @end 113 @end
119 114
120 class URLOpenerTest : public PlatformTest { 115 class URLOpenerTest : public PlatformTest {
121 protected: 116 protected:
122 void TearDown() override {
123 [main_controller_ stopChromeMain];
124 PlatformTest::TearDown();
125 }
126
127 MainController* GetMainController() { 117 MainController* GetMainController() {
128 if (!main_controller_) { 118 if (!main_controller_) {
129 main_controller_ = [[MainController alloc] init]; 119 main_controller_ = [[MainController alloc] init];
130 [main_controller_ setUpAsForegrounded]; 120 [main_controller_ setUpAsForegrounded];
131 id mainTabModel = [OCMockObject mockForClass:[TabModel class]]; 121 id mainTabModel = [OCMockObject mockForClass:[TabModel class]];
132 [[mainTabModel stub] resetSessionMetrics]; 122 [[mainTabModel stub] resetSessionMetrics];
133 [[mainTabModel stub] browserStateDestroyed]; 123 [[mainTabModel stub] browserStateDestroyed];
134 [[mainTabModel stub] addObserver:[OCMArg any]]; 124 [[mainTabModel stub] addObserver:[OCMArg any]];
135 [[mainTabModel stub] removeObserver:[OCMArg any]]; 125 [[mainTabModel stub] removeObserver:[OCMArg any]];
136 [[main_controller_ browserViewInformation] setMainTabModel:mainTabModel]; 126 [[main_controller_ browserViewInformation] setMainTabModel:mainTabModel];
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 [URLOpener handleLaunchOptions:launchOptions 474 [URLOpener handleLaunchOptions:launchOptions
485 applicationActive:NO 475 applicationActive:NO
486 tabOpener:tabOpenerMock 476 tabOpener:tabOpenerMock
487 startupInformation:startupInformationMock 477 startupInformation:startupInformationMock
488 appState:appStateMock]; 478 appState:appStateMock];
489 479
490 // Test. 480 // Test.
491 EXPECT_TRUE(hasBeenCalled); 481 EXPECT_TRUE(hasBeenCalled);
492 EXPECT_OCMOCK_VERIFY(startupInformationMock); 482 EXPECT_OCMOCK_VERIFY(startupInformationMock);
493 } 483 }
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/app/main_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698