| Index: content/shell/renderer/test_runner/test_runner.cc
|
| diff --git a/content/shell/renderer/test_runner/test_runner.cc b/content/shell/renderer/test_runner/test_runner.cc
|
| index fe33ffe73ea383cbbaca39baff1485aa8ed75720..ab5e18a729b95f6bdbfa8095597998544bd46024 100644
|
| --- a/content/shell/renderer/test_runner/test_runner.cc
|
| +++ b/content/shell/renderer/test_runner/test_runner.cc
|
| @@ -10,6 +10,7 @@
|
| #include "content/shell/common/test_runner/test_preferences.h"
|
| #include "content/shell/renderer/binding_helpers.h"
|
| #include "content/shell/renderer/test_runner/WebTestDelegate.h"
|
| +#include "content/shell/renderer/test_runner/mock_credential_manager_client.h"
|
| #include "content/shell/renderer/test_runner/mock_web_push_client.h"
|
| #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
|
| #include "content/shell/renderer/test_runner/notification_presenter.h"
|
| @@ -27,6 +28,7 @@
|
| #include "third_party/WebKit/public/platform/WebData.h"
|
| #include "third_party/WebKit/public/platform/WebDeviceMotionData.h"
|
| #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h"
|
| +#include "third_party/WebKit/public/platform/WebLocalCredential.h"
|
| #include "third_party/WebKit/public/platform/WebPoint.h"
|
| #include "third_party/WebKit/public/platform/WebURLResponse.h"
|
| #include "third_party/WebKit/public/web/WebArrayBufferConverter.h"
|
| @@ -278,6 +280,10 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
|
| void SetMockSpeechRecognitionError(const std::string& error,
|
| const std::string& message);
|
| bool WasMockSpeechRecognitionAborted();
|
| + void AddMockCredentialManagerResponse(const std::string& id,
|
| + const std::string& name,
|
| + const std::string& avatar,
|
| + const std::string& password);
|
| void AddWebPageOverlay();
|
| void RemoveWebPageOverlay();
|
| void DisplayAsync();
|
| @@ -515,6 +521,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
|
| &TestRunnerBindings::SetMockSpeechRecognitionError)
|
| .SetMethod("wasMockSpeechRecognitionAborted",
|
| &TestRunnerBindings::WasMockSpeechRecognitionAborted)
|
| + .SetMethod("addMockCredentialManagerResponse",
|
| + &TestRunnerBindings::AddMockCredentialManagerResponse)
|
| .SetMethod("addWebPageOverlay", &TestRunnerBindings::AddWebPageOverlay)
|
| .SetMethod("removeWebPageOverlay",
|
| &TestRunnerBindings::RemoveWebPageOverlay)
|
| @@ -1323,6 +1331,15 @@ bool TestRunnerBindings::WasMockSpeechRecognitionAborted() {
|
| return false;
|
| }
|
|
|
| +void TestRunnerBindings::AddMockCredentialManagerResponse(
|
| + const std::string& id,
|
| + const std::string& name,
|
| + const std::string& avatar,
|
| + const std::string& password) {
|
| + if (runner_)
|
| + runner_->AddMockCredentialManagerResponse(id, name, avatar, password);
|
| +}
|
| +
|
| void TestRunnerBindings::AddWebPageOverlay() {
|
| if (runner_)
|
| runner_->AddWebPageOverlay();
|
| @@ -2751,6 +2768,17 @@ bool TestRunner::WasMockSpeechRecognitionAborted() {
|
| return proxy_->GetSpeechRecognizerMock()->WasAborted();
|
| }
|
|
|
| +void TestRunner::AddMockCredentialManagerResponse(const std::string& id,
|
| + const std::string& name,
|
| + const std::string& avatar,
|
| + const std::string& password) {
|
| + proxy_->GetCredentialManagerClientMock()->SetResponse(
|
| + new WebLocalCredential(WebString::fromUTF8(id),
|
| + WebString::fromUTF8(name),
|
| + WebURL(GURL(avatar)),
|
| + WebString::fromUTF8(password)));
|
| +}
|
| +
|
| void TestRunner::AddWebPageOverlay() {
|
| if (web_view_ && !page_overlay_) {
|
| page_overlay_ = new TestPageOverlay(web_view_);
|
|
|