OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 " {" | 740 " {" |
741 " \"kty\": \"oct\"," | 741 " \"kty\": \"oct\"," |
742 " \"alg\": \"A128KW\"," | 742 " \"alg\": \"A128KW\"," |
743 " \"kid\": \"AAECAwQFBgcICQoLDA0ODxAREhM\"," | 743 " \"kid\": \"AAECAwQFBgcICQoLDA0ODxAREhM\"," |
744 " \"k\": \"FBUWFxgZGhscHR4fICEiIw\"" | 744 " \"k\": \"FBUWFxgZGhscHR4fICEiIw\"" |
745 " }," | 745 " }," |
746 " {" | 746 " {" |
747 " \"kty\": \"oct\"," | 747 " \"kty\": \"oct\"," |
748 " \"alg\": \"A128KW\"," | 748 " \"alg\": \"A128KW\"," |
749 " \"kid\": \"JCUmJygpKissLS4vMA\"," | 749 " \"kid\": \"JCUmJygpKissLS4vMA\"," |
750 " \"k\":\"MTIzNDU2Nzg5Ojs8PT4/QA\"" | 750 " \"k\":\"MTIzNDU2Nzg5Ojs8PT4_QA\"" |
751 " }" | 751 " }" |
752 " ]" | 752 " ]" |
753 "}"; | 753 "}"; |
754 UpdateSessionAndExpect(session_id, kJwksMultipleEntries, RESOLVED); | 754 UpdateSessionAndExpect(session_id, kJwksMultipleEntries, RESOLVED); |
755 | 755 |
756 // Try a key with no spaces and some \n plus additional fields. | 756 // Try a key with no spaces and some \n plus additional fields. |
757 const std::string kJwksNoSpaces = | 757 const std::string kJwksNoSpaces = |
758 "\n\n{\"something\":1,\"keys\":[{\n\n\"kty\":\"oct\",\"alg\":\"A128KW\"," | 758 "\n\n{\"something\":1,\"keys\":[{\n\n\"kty\":\"oct\",\"alg\":\"A128KW\"," |
759 "\"kid\":\"AAECAwQFBgcICQoLDA0ODxAREhM\",\"k\":\"GawgguFyGrWKav7AX4VKUg" | 759 "\"kid\":\"AAECAwQFBgcICQoLDA0ODxAREhM\",\"k\":\"GawgguFyGrWKav7AX4VKUg" |
760 "\",\"foo\":\"bar\"}]}\n\n"; | 760 "\",\"foo\":\"bar\"}]}\n\n"; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 EXPECT_TRUE(KeysInfoContains(key_id1)); | 871 EXPECT_TRUE(KeysInfoContains(key_id1)); |
872 EXPECT_FALSE(KeysInfoContains(key_id2)); | 872 EXPECT_FALSE(KeysInfoContains(key_id2)); |
873 | 873 |
874 // Add second key, verify both IDs returned. | 874 // Add second key, verify both IDs returned. |
875 UpdateSessionAndExpect(session_id, kKey2AsJWK, RESOLVED); | 875 UpdateSessionAndExpect(session_id, kKey2AsJWK, RESOLVED); |
876 EXPECT_TRUE(KeysInfoContains(key_id1)); | 876 EXPECT_TRUE(KeysInfoContains(key_id1)); |
877 EXPECT_TRUE(KeysInfoContains(key_id2)); | 877 EXPECT_TRUE(KeysInfoContains(key_id2)); |
878 } | 878 } |
879 | 879 |
880 } // namespace media | 880 } // namespace media |
OLD | NEW |