| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/PasswordCredential.h" | 5 #include "modules/credentialmanager/PasswordCredential.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 9 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| 10 #include "core/dom/URLSearchParams.h" | 11 #include "core/dom/URLSearchParams.h" |
| 11 #include "core/frame/FrameView.h" | 12 #include "core/frame/FrameView.h" |
| 12 #include "core/html/FormData.h" | 13 #include "core/html/FormData.h" |
| 13 #include "core/html/HTMLFormElement.h" | 14 #include "core/html/HTMLFormElement.h" |
| 14 #include "core/html/forms/FormController.h" | 15 #include "core/html/forms/FormController.h" |
| 15 #include "core/testing/DummyPageHolder.h" | 16 #include "core/testing/DummyPageHolder.h" |
| 17 #include "platform/wtf/text/StringBuilder.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "wtf/text/StringBuilder.h" | |
| 18 #include <memory> | |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 | 21 |
| 22 class PasswordCredentialTest : public ::testing::Test { | 22 class PasswordCredentialTest : public ::testing::Test { |
| 23 protected: | 23 protected: |
| 24 void SetUp() override { | 24 void SetUp() override { |
| 25 dummy_page_holder_ = DummyPageHolder::Create(); | 25 dummy_page_holder_ = DummyPageHolder::Create(); |
| 26 document_ = &dummy_page_holder_->GetDocument(); | 26 document_ = &dummy_page_holder_->GetDocument(); |
| 27 } | 27 } |
| 28 | 28 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 DummyExceptionStateForTesting exception_state; | 150 DummyExceptionStateForTesting exception_state; |
| 151 PasswordCredential* credential = | 151 PasswordCredential* credential = |
| 152 PasswordCredential::Create(form, exception_state); | 152 PasswordCredential::Create(form, exception_state); |
| 153 EXPECT_EQ(nullptr, credential); | 153 EXPECT_EQ(nullptr, credential); |
| 154 EXPECT_TRUE(exception_state.HadException()); | 154 EXPECT_TRUE(exception_state.HadException()); |
| 155 EXPECT_EQ(kV8TypeError, exception_state.Code()); | 155 EXPECT_EQ(kV8TypeError, exception_state.Code()); |
| 156 EXPECT_EQ("'id' must not be empty.", exception_state.Message()); | 156 EXPECT_EQ("'id' must not be empty.", exception_state.Message()); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace blink | 159 } // namespace blink |
| OLD | NEW |