Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: net/dns/record_parsed_unittest.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/record_parsed.cc ('k') | net/dns/record_rdata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/record_parsed_unittest.cc
diff --git a/net/dns/record_parsed_unittest.cc b/net/dns/record_parsed_unittest.cc
deleted file mode 100644
index 2864dcbe761cdcd6a6115e9e342e7e971331c315..0000000000000000000000000000000000000000
--- a/net/dns/record_parsed_unittest.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/dns/record_parsed.h"
-
-#include "net/dns/dns_protocol.h"
-#include "net/dns/dns_response.h"
-#include "net/dns/dns_test_util.h"
-#include "net/dns/record_rdata.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace net {
-
-static const uint8 kT1ResponseWithCacheFlushBit[] = {
- 0x0a, 'c', 'o', 'd', 'e', 'r', 'e', 'v', 'i', 'e', 'w',
- 0x08, 'c', 'h', 'r', 'o', 'm', 'i', 'u', 'm',
- 0x03, 'o', 'r', 'g',
- 0x00,
- 0x00, 0x05, // TYPE is CNAME.
- 0x80, 0x01, // CLASS is IN with cache flush bit set.
- 0x00, 0x01, // TTL (4 bytes) is 20 hours, 47 minutes, 48 seconds.
- 0x24, 0x74,
- 0x00, 0x12, // RDLENGTH is 18 bytes.
- // ghs.l.google.com in DNS format.
- 0x03, 'g', 'h', 's',
- 0x01, 'l',
- 0x06, 'g', 'o', 'o', 'g', 'l', 'e',
- 0x03, 'c', 'o', 'm',
- 0x00
-};
-
-TEST(RecordParsedTest, ParseSingleRecord) {
- DnsRecordParser parser(kT1ResponseDatagram, sizeof(kT1ResponseDatagram),
- sizeof(dns_protocol::Header));
- scoped_ptr<const RecordParsed> record;
- const CnameRecordRdata* rdata;
-
- parser.SkipQuestion();
- record = RecordParsed::CreateFrom(&parser, base::Time());
- EXPECT_TRUE(record != NULL);
-
- ASSERT_EQ("codereview.chromium.org", record->name());
- ASSERT_EQ(dns_protocol::kTypeCNAME, record->type());
- ASSERT_EQ(dns_protocol::kClassIN, record->klass());
-
- rdata = record->rdata<CnameRecordRdata>();
- ASSERT_TRUE(rdata != NULL);
- ASSERT_EQ(kT1CanonName, rdata->cname());
-
- ASSERT_FALSE(record->rdata<SrvRecordRdata>());
- ASSERT_TRUE(record->IsEqual(record.get(), true));
-}
-
-TEST(RecordParsedTest, CacheFlushBitCompare) {
- DnsRecordParser parser1(kT1ResponseDatagram, sizeof(kT1ResponseDatagram),
- sizeof(dns_protocol::Header));
- parser1.SkipQuestion();
- scoped_ptr<const RecordParsed> record1 =
- RecordParsed::CreateFrom(&parser1, base::Time());
-
- DnsRecordParser parser2(kT1ResponseWithCacheFlushBit,
- sizeof(kT1ResponseWithCacheFlushBit),
- 0);
-
- scoped_ptr<const RecordParsed> record2 =
- RecordParsed::CreateFrom(&parser2, base::Time());
-
- EXPECT_FALSE(record1->IsEqual(record2.get(), false));
- EXPECT_TRUE(record1->IsEqual(record2.get(), true));
- EXPECT_FALSE(record2->IsEqual(record1.get(), false));
- EXPECT_TRUE(record2->IsEqual(record1.get(), true));
-}
-
-} //namespace net
« no previous file with comments | « net/dns/record_parsed.cc ('k') | net/dns/record_rdata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698