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

Side by Side Diff: components/password_manager/content/renderer/credential_manager_client_browsertest.cc

Issue 1124393003: Fix cleanup in CredentialManagerClientTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698