| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/webcrypto/test/test_helpers.h" | 5 #include "content/child/webcrypto/test/test_helpers.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 case blink::WebCryptoErrorTypeNotSupported: | 73 case blink::WebCryptoErrorTypeNotSupported: |
| 74 return "NotSupported"; | 74 return "NotSupported"; |
| 75 case blink::WebCryptoErrorTypeType: | 75 case blink::WebCryptoErrorTypeType: |
| 76 return "TypeError"; | 76 return "TypeError"; |
| 77 case blink::WebCryptoErrorTypeData: | 77 case blink::WebCryptoErrorTypeData: |
| 78 return "DataError"; | 78 return "DataError"; |
| 79 case blink::WebCryptoErrorTypeSyntax: | 79 case blink::WebCryptoErrorTypeSyntax: |
| 80 return "SyntaxError"; | 80 return "SyntaxError"; |
| 81 case blink::WebCryptoErrorTypeOperation: | 81 case blink::WebCryptoErrorTypeOperation: |
| 82 return "OperationError"; | 82 return "OperationError"; |
| 83 case blink::WebCryptoErrorTypeUnknown: | |
| 84 return "UnknownError"; | |
| 85 case blink::WebCryptoErrorTypeInvalidState: | |
| 86 return "InvalidState"; | |
| 87 case blink::WebCryptoErrorTypeInvalidAccess: | 83 case blink::WebCryptoErrorTypeInvalidAccess: |
| 88 return "InvalidAccess"; | 84 return "InvalidAccess"; |
| 85 default: |
| 86 return "?"; |
| 89 } | 87 } |
| 90 | |
| 91 return "?"; | |
| 92 } | 88 } |
| 93 | 89 |
| 94 std::string StatusToString(const Status& status) { | 90 std::string StatusToString(const Status& status) { |
| 95 if (status.IsSuccess()) | 91 if (status.IsSuccess()) |
| 96 return "Success"; | 92 return "Success"; |
| 97 | 93 |
| 98 std::string result = ErrorTypeToString(status.error_type()); | 94 std::string result = ErrorTypeToString(status.error_type()); |
| 99 if (!status.error_details().empty()) | 95 if (!status.error_details().empty()) |
| 100 result += ": " + status.error_details(); | 96 result += ": " + status.error_details(); |
| 101 return result; | 97 return result; |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 return blink::WebCryptoNamedCurveP521; | 681 return blink::WebCryptoNamedCurveP521; |
| 686 else | 682 else |
| 687 ADD_FAILURE() << "Unrecognized curve name: " << curve_str; | 683 ADD_FAILURE() << "Unrecognized curve name: " << curve_str; |
| 688 | 684 |
| 689 return blink::WebCryptoNamedCurveP384; | 685 return blink::WebCryptoNamedCurveP384; |
| 690 } | 686 } |
| 691 | 687 |
| 692 } // namespace webcrypto | 688 } // namespace webcrypto |
| 693 | 689 |
| 694 } // namesapce content | 690 } // namesapce content |
| OLD | NEW |