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

Unified Diff: third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp

Issue 2852423002: Expose passwords to JavaScript in Credential Manager API (Closed)
Patch Set: Runtime Enabled Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp
diff --git a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp
index e77c62dbf63a78805bdd63e2d3928c797db5780c..17e83f74fafe77b51c4220a95527dfad2c8451ed 100644
--- a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp
+++ b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredentialTest.cpp
@@ -14,6 +14,7 @@
#include "core/html/HTMLFormElement.h"
#include "core/html/forms/FormController.h"
#include "core/testing/DummyPageHolder.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/wtf/text/StringBuilder.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -67,7 +68,8 @@ TEST_F(PasswordCredentialTest, CreateFromMultipartForm) {
EXPECT_EQ("thePassword", credential->passwordName());
EXPECT_EQ("musterman", credential->id());
- EXPECT_EQ("sekrit", credential->Password());
+ if (RuntimeEnabledFeatures::passwordCredentialPasswordEnabled())
+ EXPECT_EQ("sekrit", credential->password());
EXPECT_EQ(KURL(kParsedURLString, "https://example.com/photo"),
credential->iconURL());
EXPECT_EQ("friendly name", credential->name());
@@ -102,7 +104,8 @@ TEST_F(PasswordCredentialTest, CreateFromURLEncodedForm) {
EXPECT_EQ("thePassword", credential->passwordName());
EXPECT_EQ("musterman", credential->id());
- EXPECT_EQ("sekrit", credential->Password());
+ if (RuntimeEnabledFeatures::passwordCredentialPasswordEnabled())
Mike West 2017/05/16 09:30:45 I'd drop these `if`s, as per the discussion above.
jdoerrie 2017/05/17 15:39:22 Done.
+ EXPECT_EQ("sekrit", credential->password());
EXPECT_EQ(KURL(kParsedURLString, "https://example.com/photo"),
credential->iconURL());
EXPECT_EQ("friendly name", credential->name());

Powered by Google App Engine
This is Rietveld 408576698