OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/password_manager/content/common/credential_manager_messages
.h" | 5 #include "components/password_manager/content/common/credential_manager_messages
.h" |
6 #include "components/password_manager/content/renderer/credential_manager_client
.h" | 6 #include "components/password_manager/content/renderer/credential_manager_client
.h" |
7 #include "content/public/test/render_view_test.h" | 7 #include "content/public/test/render_view_test.h" |
8 #include "ipc/ipc_test_sink.h" | 8 #include "ipc/ipc_test_sink.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/WebKit/public/platform/WebCredential.h" | 10 #include "third_party/WebKit/public/platform/WebCredential.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 ~MAYBE_CredentialManagerClientTest() override {} | 32 ~MAYBE_CredentialManagerClientTest() override {} |
33 | 33 |
34 void SetUp() override { | 34 void SetUp() override { |
35 content::RenderViewTest::SetUp(); | 35 content::RenderViewTest::SetUp(); |
36 credential_.reset(new blink::WebLocalCredential("", "", GURL(), "")); | 36 credential_.reset(new blink::WebLocalCredential("", "", GURL(), "")); |
37 client_.reset(new CredentialManagerClient(view_)); | 37 client_.reset(new CredentialManagerClient(view_)); |
38 } | 38 } |
39 | 39 |
40 void TearDown() override { | 40 void TearDown() override { |
41 credential_.reset(); | 41 credential_.reset(); |
| 42 client_.reset(); |
42 content::RenderViewTest::TearDown(); | 43 content::RenderViewTest::TearDown(); |
43 } | 44 } |
44 | 45 |
45 IPC::TestSink& sink() { return render_thread_->sink(); } | 46 IPC::TestSink& sink() { return render_thread_->sink(); } |
46 | 47 |
47 blink::WebCredential* credential() { return credential_.get(); } | 48 blink::WebCredential* credential() { return credential_.get(); } |
48 | 49 |
49 // The browser's response to any of the messages the client sends must contain | 50 // The browser's response to any of the messages the client sends must contain |
50 // a request ID so that the client knows which request is being serviced. This | 51 // a request ID so that the client knows which request is being serviced. This |
51 // method grabs the ID from an outgoing |message_id| message, and sets the | 52 // method grabs the ID from an outgoing |message_id| message, and sets the |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 EXPECT_TRUE(ExtractRequestId(CredentialManagerHostMsg_RequestCredential::ID, | 237 EXPECT_TRUE(ExtractRequestId(CredentialManagerHostMsg_RequestCredential::ID, |
237 request_id)); | 238 request_id)); |
238 | 239 |
239 CredentialInfo info; // Send an empty credential in response. | 240 CredentialInfo info; // Send an empty credential in response. |
240 client_->OnSendCredential(request_id, info); | 241 client_->OnSendCredential(request_id, info); |
241 EXPECT_TRUE(callback_succeeded()); | 242 EXPECT_TRUE(callback_succeeded()); |
242 EXPECT_FALSE(callback_errored()); | 243 EXPECT_FALSE(callback_errored()); |
243 } | 244 } |
244 | 245 |
245 } // namespace password_manager | 246 } // namespace password_manager |
OLD | NEW |