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

Side by Side Diff: ios/chrome/browser/signin/gaia_auth_fetcher_ios_unittest.mm

Issue 2239773002: Annotates functions returning retained objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removes functions that are not in headers AND not in ios code. Created 4 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/signin/gaia_auth_fetcher_ios.h" 5 #include "ios/chrome/browser/signin/gaia_auth_fetcher_ios.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #import "base/mac/scoped_nsobject.h" 9 #import "base/mac/scoped_nsobject.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 11 matching lines...) Expand all
22 22
23 namespace { 23 namespace {
24 24
25 class FakeGaiaAuthFetcherIOSBridge : public GaiaAuthFetcherIOSBridge { 25 class FakeGaiaAuthFetcherIOSBridge : public GaiaAuthFetcherIOSBridge {
26 public: 26 public:
27 FakeGaiaAuthFetcherIOSBridge(GaiaAuthFetcherIOS* fetcher, 27 FakeGaiaAuthFetcherIOSBridge(GaiaAuthFetcherIOS* fetcher,
28 web::BrowserState* browser_state) 28 web::BrowserState* browser_state)
29 : GaiaAuthFetcherIOSBridge(fetcher, browser_state), mock_web_view_(nil) {} 29 : GaiaAuthFetcherIOSBridge(fetcher, browser_state), mock_web_view_(nil) {}
30 30
31 private: 31 private:
32 WKWebView* CreateWKWebView() override { 32 WKWebView* CreateWKWebView() override NS_RETURNS_RETAINED {
33 if (!mock_web_view_) { 33 if (!mock_web_view_) {
34 mock_web_view_ = [OCMockObject niceMockForClass:[WKWebView class]]; 34 mock_web_view_ = [OCMockObject niceMockForClass:[WKWebView class]];
35 } 35 }
36 return [mock_web_view_ retain]; 36 return [mock_web_view_ retain];
37 } 37 }
38 id mock_web_view_; 38 id mock_web_view_;
39 }; 39 };
40 40
41 class MockGaiaConsumer : public GaiaAuthConsumer { 41 class MockGaiaConsumer : public GaiaAuthConsumer {
42 public: 42 public:
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 [[GetMockWKWebView() expect] setNavigationDelegate:[OCMArg isNotNil]]; 183 [[GetMockWKWebView() expect] setNavigationDelegate:[OCMArg isNotNil]];
184 [static_cast<WKWebView*>([[GetMockWKWebView() expect] andDo:^(NSInvocation*) { 184 [static_cast<WKWebView*>([[GetMockWKWebView() expect] andDo:^(NSInvocation*) {
185 GetBridge()->URLFetchSuccess("data"); 185 GetBridge()->URLFetchSuccess("data");
186 }]) loadRequest:[OCMArg any]]; 186 }]) loadRequest:[OCMArg any]];
187 187
188 gaia_auth_fetcher_->StartMergeSession("uber_token", ""); 188 gaia_auth_fetcher_->StartMergeSession("uber_token", "");
189 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); 189 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false);
190 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(true); 190 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(true);
191 EXPECT_OCMOCK_VERIFY(GetMockWKWebView()); 191 EXPECT_OCMOCK_VERIFY(GetMockWKWebView());
192 } 192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698