| OLD | NEW |
| 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" |
| 11 #include "google_apis/gaia/gaia_urls.h" | 11 #include "google_apis/gaia/gaia_urls.h" |
| 12 #include "ios/chrome/browser/signin/gaia_auth_fetcher_ios_private.h" | 12 #include "ios/chrome/browser/signin/gaia_auth_fetcher_ios_private.h" |
| 13 #include "ios/web/public/test/test_browser_state.h" | 13 #include "ios/web/public/test/fakes/test_browser_state.h" |
| 14 #include "ios/web/public/test/test_web_thread_bundle.h" | 14 #include "ios/web/public/test/test_web_thread_bundle.h" |
| 15 #include "net/url_request/test_url_fetcher_factory.h" | 15 #include "net/url_request/test_url_fetcher_factory.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #import "testing/gtest_mac.h" | 18 #import "testing/gtest_mac.h" |
| 19 #include "testing/platform_test.h" | 19 #include "testing/platform_test.h" |
| 20 #import "third_party/ocmock/OCMock/OCMock.h" | 20 #import "third_party/ocmock/OCMock/OCMock.h" |
| 21 #import "third_party/ocmock/gtest_support.h" | 21 #import "third_party/ocmock/gtest_support.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 [[GetMockWKWebView() expect] setNavigationDelegate:[OCMArg isNotNil]]; | 184 [[GetMockWKWebView() expect] setNavigationDelegate:[OCMArg isNotNil]]; |
| 185 [static_cast<WKWebView*>([[GetMockWKWebView() expect] andDo:^(NSInvocation*) { | 185 [static_cast<WKWebView*>([[GetMockWKWebView() expect] andDo:^(NSInvocation*) { |
| 186 GetBridge()->URLFetchSuccess("data"); | 186 GetBridge()->URLFetchSuccess("data"); |
| 187 }]) loadRequest:[OCMArg any]]; | 187 }]) loadRequest:[OCMArg any]]; |
| 188 | 188 |
| 189 gaia_auth_fetcher_->StartMergeSession("uber_token", ""); | 189 gaia_auth_fetcher_->StartMergeSession("uber_token", ""); |
| 190 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); | 190 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); |
| 191 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(true); | 191 web::BrowserState::GetActiveStateManager(&browser_state_)->SetActive(true); |
| 192 EXPECT_OCMOCK_VERIFY(GetMockWKWebView()); | 192 EXPECT_OCMOCK_VERIFY(GetMockWKWebView()); |
| 193 } | 193 } |
| OLD | NEW |