OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "modules/credentialmanager/CredentialsContainer.h" | 5 #include "modules/credentialmanager/CredentialsContainer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
10 #include "bindings/core/v8/V8GCController.h" | 10 #include "bindings/core/v8/V8GCController.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 using ::testing::SaveArg; | 22 using ::testing::SaveArg; |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 class MockCredentialManagerClient : public WebCredentialManagerClient { | 26 class MockCredentialManagerClient : public WebCredentialManagerClient { |
27 public: | 27 public: |
28 MOCK_METHOD2(DispatchFailedSignIn, | 28 MOCK_METHOD2(DispatchFailedSignIn, |
29 void(const WebCredential&, NotificationCallbacks*)); | 29 void(const WebCredential&, NotificationCallbacks*)); |
30 MOCK_METHOD2(DispatchStore, | 30 MOCK_METHOD2(DispatchStore, |
31 void(const WebCredential&, NotificationCallbacks*)); | 31 void(const WebCredential&, NotificationCallbacks*)); |
32 MOCK_METHOD1(DispatchRequireUserMediation, void(NotificationCallbacks*)); | 32 MOCK_METHOD1(DispatchPreventSilentAccess, void(NotificationCallbacks*)); |
33 MOCK_METHOD4(DispatchGet, | 33 MOCK_METHOD4(DispatchGet, |
34 void(WebCredentialMediationRequirement, | 34 void(WebCredentialMediationRequirement, |
35 bool, | 35 bool, |
36 const WebVector<WebURL>& federations, | 36 const WebVector<WebURL>& federations, |
37 RequestCallbacks*)); | 37 RequestCallbacks*)); |
38 }; | 38 }; |
39 | 39 |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 // Make a call to CredentialsContainer::get(). Destroy v8::Context. | 42 // Make a call to CredentialsContainer::get(). Destroy v8::Context. |
(...skipping 22 matching lines...) Expand all Loading... |
65 } | 65 } |
66 | 66 |
67 // Garbage collect v8::Context. | 67 // Garbage collect v8::Context. |
68 V8GCController::CollectAllGarbageForTesting(v8::Isolate::GetCurrent()); | 68 V8GCController::CollectAllGarbageForTesting(v8::Isolate::GetCurrent()); |
69 | 69 |
70 // Invoking the callback shouldn't crash. | 70 // Invoking the callback shouldn't crash. |
71 get_callback->OnSuccess(std::unique_ptr<WebCredential>()); | 71 get_callback->OnSuccess(std::unique_ptr<WebCredential>()); |
72 } | 72 } |
73 | 73 |
74 } // namespace blink | 74 } // namespace blink |
OLD | NEW |