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

Side by Side Diff: content/shell/test_runner/mock_credential_manager_client.cc

Issue 2707183003: Move //components/test_runner back into //content/shell (Closed)
Patch Set: Trim DEPS Created 3 years, 10 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 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/test_runner/mock_credential_manager_client.h" 5 #include "content/shell/test_runner/mock_credential_manager_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "third_party/WebKit/public/platform/WebCredential.h" 10 #include "third_party/WebKit/public/platform/WebCredential.h"
11 11
12 namespace test_runner { 12 namespace test_runner {
13 13
14 MockCredentialManagerClient::MockCredentialManagerClient() 14 MockCredentialManagerClient::MockCredentialManagerClient()
15 : error_(blink::WebCredentialManagerNoError) {} 15 : error_(blink::WebCredentialManagerNoError) {}
16 16
17 MockCredentialManagerClient::~MockCredentialManagerClient() { 17 MockCredentialManagerClient::~MockCredentialManagerClient() {}
18 }
19 18
20 void MockCredentialManagerClient::SetResponse( 19 void MockCredentialManagerClient::SetResponse(
21 blink::WebCredential* credential) { 20 blink::WebCredential* credential) {
22 credential_.reset(credential); 21 credential_.reset(credential);
23 } 22 }
24 23
25 void MockCredentialManagerClient::SetError(const std::string& error) { 24 void MockCredentialManagerClient::SetError(const std::string& error) {
26 if (error == "pending") 25 if (error == "pending")
27 error_ = blink::WebCredentialManagerPendingRequestError; 26 error_ = blink::WebCredentialManagerPendingRequestError;
28 if (error == "disabled") 27 if (error == "disabled")
(...skipping 23 matching lines...) Expand all
52 const blink::WebVector<blink::WebURL>& federations, 51 const blink::WebVector<blink::WebURL>& federations,
53 RequestCallbacks* callbacks) { 52 RequestCallbacks* callbacks) {
54 if (error_ != blink::WebCredentialManagerNoError) 53 if (error_ != blink::WebCredentialManagerNoError)
55 callbacks->onError(error_); 54 callbacks->onError(error_);
56 else 55 else
57 callbacks->onSuccess(std::move(credential_)); 56 callbacks->onSuccess(std::move(credential_));
58 delete callbacks; 57 delete callbacks;
59 } 58 }
60 59
61 } // namespace test_runner 60 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698