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 <stdint.h> |
| 6 |
5 #include "device/bluetooth/uribeacon/uri_encoder.h" | 7 #include "device/bluetooth/uribeacon/uri_encoder.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
7 | 9 |
8 namespace device { | 10 namespace device { |
9 | 11 |
10 TEST(UriEncoderTest, Url1) { | 12 TEST(UriEncoderTest, Url1) { |
11 const std::string kUri = "http://123.com"; | 13 const std::string kUri = "http://123.com"; |
12 const char encoded_uri[] = {2, '1', '2', '3', 7}; | 14 const char encoded_uri[] = {2, '1', '2', '3', 7}; |
13 const std::vector<uint8_t> kEncodedUri(encoded_uri, | 15 const std::vector<uint8_t> kEncodedUri(encoded_uri, |
14 encoded_uri + sizeof(encoded_uri)); | 16 encoded_uri + sizeof(encoded_uri)); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 std::string decoded; | 86 std::string decoded; |
85 | 87 |
86 EncodeUriBeaconUri(kUri, encoded); | 88 EncodeUriBeaconUri(kUri, encoded); |
87 EXPECT_EQ(kEncodedUri, encoded); | 89 EXPECT_EQ(kEncodedUri, encoded); |
88 | 90 |
89 DecodeUriBeaconUri(encoded, decoded); | 91 DecodeUriBeaconUri(encoded, decoded); |
90 EXPECT_EQ(kUri, decoded); | 92 EXPECT_EQ(kUri, decoded); |
91 } | 93 } |
92 | 94 |
93 } // namespace device | 95 } // namespace device |
OLD | NEW |