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" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "wtf/text/StringBuilder.h" | 18 #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 m_dummyPageHolder = DummyPageHolder::create(); | 25 m_dummyPageHolder = DummyPageHolder::create(); |
26 m_document = &m_dummyPageHolder->document(); | 26 m_document = &m_dummyPageHolder->document(); |
27 } | 27 } |
28 | 28 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 DummyExceptionStateForTesting exceptionState; | 150 DummyExceptionStateForTesting exceptionState; |
151 PasswordCredential* credential = | 151 PasswordCredential* credential = |
152 PasswordCredential::create(form, exceptionState); | 152 PasswordCredential::create(form, exceptionState); |
153 EXPECT_EQ(nullptr, credential); | 153 EXPECT_EQ(nullptr, credential); |
154 EXPECT_TRUE(exceptionState.hadException()); | 154 EXPECT_TRUE(exceptionState.hadException()); |
155 EXPECT_EQ(V8TypeError, exceptionState.code()); | 155 EXPECT_EQ(V8TypeError, exceptionState.code()); |
156 EXPECT_EQ("'id' must not be empty.", exceptionState.message()); | 156 EXPECT_EQ("'id' must not be empty.", exceptionState.message()); |
157 } | 157 } |
158 | 158 |
159 } // namespace blink | 159 } // namespace blink |
OLD | NEW |