| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/web/public/web_state/js/credential_util.h" | 5 #include "ios/web/public/web_state/js/credential_util.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "ios/web/public/web_state/credential.h" | 12 #include "ios/web/public/web_state/credential.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "testing/gtest_mac.h" | 15 #import "testing/gtest_mac.h" |
| 16 #include "testing/platform_test.h" | 16 #include "testing/platform_test.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 #include "url/origin.h" | 18 #include "url/origin.h" |
| 19 | 19 |
| 20 namespace web { | 20 namespace web { |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // "type" value for a DictionaryValue representation of PasswordCredential. | 23 // "type" value for a DictionaryValue representation of PasswordCredential. |
| 24 const char* kTestCredentialTypePassword = "PasswordCredential"; | 24 const char* kTestCredentialTypePassword = "PasswordCredential"; |
| 25 | 25 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 TEST(CredentialUtilTest, SerializeEmptyCredentialIntoNonEmptyDictionary) { | 223 TEST(CredentialUtilTest, SerializeEmptyCredentialIntoNonEmptyDictionary) { |
| 224 base::DictionaryValue value; | 224 base::DictionaryValue value; |
| 225 value.SetString("foo", "bar"); | 225 value.SetString("foo", "bar"); |
| 226 Credential credential; | 226 Credential credential; |
| 227 CredentialToDictionaryValue(credential, &value); | 227 CredentialToDictionaryValue(credential, &value); |
| 228 EXPECT_TRUE(base::WrapUnique(new base::DictionaryValue)->Equals(&value)); | 228 EXPECT_TRUE(base::WrapUnique(new base::DictionaryValue)->Equals(&value)); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace | 231 } // namespace |
| 232 } // namespace web | 232 } // namespace web |
| OLD | NEW |