| Index: chrome/utility/local_discovery/service_discovery_client_unittest.cc
|
| diff --git a/chrome/utility/local_discovery/service_discovery_client_unittest.cc b/chrome/utility/local_discovery/service_discovery_client_unittest.cc
|
| index b79d86ebcbe2a8c33f4861153af561897a18d762..2f7a15db4a6774ad0fc39740732c281f0e639d25 100644
|
| --- a/chrome/utility/local_discovery/service_discovery_client_unittest.cc
|
| +++ b/chrome/utility/local_discovery/service_discovery_client_unittest.cc
|
| @@ -26,113 +26,113 @@ namespace local_discovery {
|
|
|
| namespace {
|
|
|
| -const char kSamplePacketPTR[] = {
|
| +const uint8 kSamplePacketPTR[] = {
|
| // Header
|
| - '\x00', '\x00', // ID is zeroed out
|
| - '\x81', '\x80', // Standard query response, RA, no error
|
| - '\x00', '\x00', // No questions (for simplicity)
|
| - '\x00', '\x01', // 1 RR (answers)
|
| - '\x00', '\x00', // 0 authority RRs
|
| - '\x00', '\x00', // 0 additional RRs
|
| -
|
| - '\x07', '_', 'p', 'r', 'i', 'v', 'e', 't',
|
| - '\x04', '_', 't', 'c', 'p',
|
| - '\x05', 'l', 'o', 'c', 'a', 'l',
|
| - '\x00',
|
| - '\x00', '\x0c', // TYPE is PTR.
|
| - '\x00', '\x01', // CLASS is IN.
|
| - '\x00', '\x00', // TTL (4 bytes) is 1 second.
|
| - '\x00', '\x01',
|
| - '\x00', '\x08', // RDLENGTH is 8 bytes.
|
| - '\x05', 'h', 'e', 'l', 'l', 'o',
|
| - '\xc0', '\x0c'
|
| + 0x00, 0x00, // ID is zeroed out
|
| + 0x81, 0x80, // Standard query response, RA, no error
|
| + 0x00, 0x00, // No questions (for simplicity)
|
| + 0x00, 0x01, // 1 RR (answers)
|
| + 0x00, 0x00, // 0 authority RRs
|
| + 0x00, 0x00, // 0 additional RRs
|
| +
|
| + 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
|
| + 0x04, '_', 't', 'c', 'p',
|
| + 0x05, 'l', 'o', 'c', 'a', 'l',
|
| + 0x00,
|
| + 0x00, 0x0c, // TYPE is PTR.
|
| + 0x00, 0x01, // CLASS is IN.
|
| + 0x00, 0x00, // TTL (4 bytes) is 1 second.
|
| + 0x00, 0x01,
|
| + 0x00, 0x08, // RDLENGTH is 8 bytes.
|
| + 0x05, 'h', 'e', 'l', 'l', 'o',
|
| + 0xc0, 0x0c
|
| };
|
|
|
| -const char kSamplePacketSRV[] = {
|
| +const uint8 kSamplePacketSRV[] = {
|
| // Header
|
| - '\x00', '\x00', // ID is zeroed out
|
| - '\x81', '\x80', // Standard query response, RA, no error
|
| - '\x00', '\x00', // No questions (for simplicity)
|
| - '\x00', '\x01', // 1 RR (answers)
|
| - '\x00', '\x00', // 0 authority RRs
|
| - '\x00', '\x00', // 0 additional RRs
|
| -
|
| - '\x05', 'h', 'e', 'l', 'l', 'o',
|
| - '\x07', '_', 'p', 'r', 'i', 'v', 'e', 't',
|
| - '\x04', '_', 't', 'c', 'p',
|
| - '\x05', 'l', 'o', 'c', 'a', 'l',
|
| - '\x00',
|
| - '\x00', '\x21', // TYPE is SRV.
|
| - '\x00', '\x01', // CLASS is IN.
|
| - '\x00', '\x00', // TTL (4 bytes) is 1 second.
|
| - '\x00', '\x01',
|
| - '\x00', '\x15', // RDLENGTH is 21 bytes.
|
| - '\x00', '\x00',
|
| - '\x00', '\x00',
|
| - '\x22', '\xb8', // port 8888
|
| - '\x07', 'm', 'y', 'h', 'e', 'l', 'l', 'o',
|
| - '\x05', 'l', 'o', 'c', 'a', 'l',
|
| - '\x00',
|
| + 0x00, 0x00, // ID is zeroed out
|
| + 0x81, 0x80, // Standard query response, RA, no error
|
| + 0x00, 0x00, // No questions (for simplicity)
|
| + 0x00, 0x01, // 1 RR (answers)
|
| + 0x00, 0x00, // 0 authority RRs
|
| + 0x00, 0x00, // 0 additional RRs
|
| +
|
| + 0x05, 'h', 'e', 'l', 'l', 'o',
|
| + 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
|
| + 0x04, '_', 't', 'c', 'p',
|
| + 0x05, 'l', 'o', 'c', 'a', 'l',
|
| + 0x00,
|
| + 0x00, 0x21, // TYPE is SRV.
|
| + 0x00, 0x01, // CLASS is IN.
|
| + 0x00, 0x00, // TTL (4 bytes) is 1 second.
|
| + 0x00, 0x01,
|
| + 0x00, 0x15, // RDLENGTH is 21 bytes.
|
| + 0x00, 0x00,
|
| + 0x00, 0x00,
|
| + 0x22, 0xb8, // port 8888
|
| + 0x07, 'm', 'y', 'h', 'e', 'l', 'l', 'o',
|
| + 0x05, 'l', 'o', 'c', 'a', 'l',
|
| + 0x00,
|
| };
|
|
|
| -const char kSamplePacketTXT[] = {
|
| +const uint8 kSamplePacketTXT[] = {
|
| // Header
|
| - '\x00', '\x00', // ID is zeroed out
|
| - '\x81', '\x80', // Standard query response, RA, no error
|
| - '\x00', '\x00', // No questions (for simplicity)
|
| - '\x00', '\x01', // 1 RR (answers)
|
| - '\x00', '\x00', // 0 authority RRs
|
| - '\x00', '\x00', // 0 additional RRs
|
| -
|
| - '\x05', 'h', 'e', 'l', 'l', 'o',
|
| - '\x07', '_', 'p', 'r', 'i', 'v', 'e', 't',
|
| - '\x04', '_', 't', 'c', 'p',
|
| - '\x05', 'l', 'o', 'c', 'a', 'l',
|
| - '\x00',
|
| - '\x00', '\x10', // TYPE is PTR.
|
| - '\x00', '\x01', // CLASS is IN.
|
| - '\x00', '\x00', // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
|
| - '\x00', '\x01',
|
| - '\x00', '\x06', // RDLENGTH is 21 bytes.
|
| - '\x05', 'h', 'e', 'l', 'l', 'o'
|
| + 0x00, 0x00, // ID is zeroed out
|
| + 0x81, 0x80, // Standard query response, RA, no error
|
| + 0x00, 0x00, // No questions (for simplicity)
|
| + 0x00, 0x01, // 1 RR (answers)
|
| + 0x00, 0x00, // 0 authority RRs
|
| + 0x00, 0x00, // 0 additional RRs
|
| +
|
| + 0x05, 'h', 'e', 'l', 'l', 'o',
|
| + 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
|
| + 0x04, '_', 't', 'c', 'p',
|
| + 0x05, 'l', 'o', 'c', 'a', 'l',
|
| + 0x00,
|
| + 0x00, 0x10, // TYPE is PTR.
|
| + 0x00, 0x01, // CLASS is IN.
|
| + 0x00, 0x00, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
|
| + 0x00, 0x01,
|
| + 0x00, 0x06, // RDLENGTH is 21 bytes.
|
| + 0x05, 'h', 'e', 'l', 'l', 'o'
|
| };
|
|
|
| -const char kSamplePacketSRVA[] = {
|
| +const uint8 kSamplePacketSRVA[] = {
|
| // Header
|
| - '\x00', '\x00', // ID is zeroed out
|
| - '\x81', '\x80', // Standard query response, RA, no error
|
| - '\x00', '\x00', // No questions (for simplicity)
|
| - '\x00', '\x02', // 2 RR (answers)
|
| - '\x00', '\x00', // 0 authority RRs
|
| - '\x00', '\x00', // 0 additional RRs
|
| -
|
| - '\x05', 'h', 'e', 'l', 'l', 'o',
|
| - '\x07', '_', 'p', 'r', 'i', 'v', 'e', 't',
|
| - '\x04', '_', 't', 'c', 'p',
|
| - '\x05', 'l', 'o', 'c', 'a', 'l',
|
| - '\x00',
|
| - '\x00', '\x21', // TYPE is SRV.
|
| - '\x00', '\x01', // CLASS is IN.
|
| - '\x00', '\x00', // TTL (4 bytes) is 16 seconds.
|
| - '\x00', '\x10',
|
| - '\x00', '\x15', // RDLENGTH is 21 bytes.
|
| - '\x00', '\x00',
|
| - '\x00', '\x00',
|
| - '\x22', '\xb8', // port 8888
|
| - '\x07', 'm', 'y', 'h', 'e', 'l', 'l', 'o',
|
| - '\x05', 'l', 'o', 'c', 'a', 'l',
|
| - '\x00',
|
| -
|
| - '\x07', 'm', 'y', 'h', 'e', 'l', 'l', 'o',
|
| - '\x05', 'l', 'o', 'c', 'a', 'l',
|
| - '\x00',
|
| - '\x00', '\x01', // TYPE is A.
|
| - '\x00', '\x01', // CLASS is IN.
|
| - '\x00', '\x00', // TTL (4 bytes) is 16 seconds.
|
| - '\x00', '\x10',
|
| - '\x00', '\x04', // RDLENGTH is 4 bytes.
|
| - '\x01', '\x02',
|
| - '\x03', '\x04',
|
| + 0x00, 0x00, // ID is zeroed out
|
| + 0x81, 0x80, // Standard query response, RA, no error
|
| + 0x00, 0x00, // No questions (for simplicity)
|
| + 0x00, 0x02, // 2 RR (answers)
|
| + 0x00, 0x00, // 0 authority RRs
|
| + 0x00, 0x00, // 0 additional RRs
|
| +
|
| + 0x05, 'h', 'e', 'l', 'l', 'o',
|
| + 0x07, '_', 'p', 'r', 'i', 'v', 'e', 't',
|
| + 0x04, '_', 't', 'c', 'p',
|
| + 0x05, 'l', 'o', 'c', 'a', 'l',
|
| + 0x00,
|
| + 0x00, 0x21, // TYPE is SRV.
|
| + 0x00, 0x01, // CLASS is IN.
|
| + 0x00, 0x00, // TTL (4 bytes) is 16 seconds.
|
| + 0x00, 0x10,
|
| + 0x00, 0x15, // RDLENGTH is 21 bytes.
|
| + 0x00, 0x00,
|
| + 0x00, 0x00,
|
| + 0x22, 0xb8, // port 8888
|
| + 0x07, 'm', 'y', 'h', 'e', 'l', 'l', 'o',
|
| + 0x05, 'l', 'o', 'c', 'a', 'l',
|
| + 0x00,
|
| +
|
| + 0x07, 'm', 'y', 'h', 'e', 'l', 'l', 'o',
|
| + 0x05, 'l', 'o', 'c', 'a', 'l',
|
| + 0x00,
|
| + 0x00, 0x01, // TYPE is A.
|
| + 0x00, 0x01, // CLASS is IN.
|
| + 0x00, 0x00, // TTL (4 bytes) is 16 seconds.
|
| + 0x00, 0x10,
|
| + 0x00, 0x04, // RDLENGTH is 4 bytes.
|
| + 0x01, 0x02,
|
| + 0x03, 0x04,
|
| };
|
|
|
| class MockServiceWatcherClient {
|
|
|