| Index: chrome/installer/mac/app/testing/OmahaXMLRequest_test.mm
|
| diff --git a/chrome/installer/mac/app/testing/OmahaXMLRequest_test.mm b/chrome/installer/mac/app/testing/OmahaXMLRequest_test.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..aa05f3cae8d207b0f9894e3d3f528baffc58957a
|
| --- /dev/null
|
| +++ b/chrome/installer/mac/app/testing/OmahaXMLRequest_test.mm
|
| @@ -0,0 +1,41 @@
|
| +// Copyright 2016 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.
|
| +
|
| +#import "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +#import "chrome/installer/mac/app/OmahaXMLRequest.h"
|
| +
|
| +namespace {
|
| +
|
| +class OmahaXMLRequestTest : public ::testing::Test {
|
| + protected:
|
| + OmahaXMLRequestTest() : Test() {
|
| + xml_body_ = [OmahaXMLRequest createXMLRequestBody];
|
| + }
|
| +
|
| + virtual ~OmahaXMLRequestTest() { [xml_body_ release]; }
|
| +
|
| + // private:
|
| + scoped_nsobject<NSXMLDocument> xml_body_;
|
| + // DISALLOW_COPY_AND_ASSIGN(NSXMLDocument);
|
| +};
|
| +
|
| +TEST_F(OmahaXMLRequestTest, CreateDoesNotReturnNil) {
|
| + EXPECT_TRUE(xml_body_);
|
| +}
|
| +
|
| +TEST_F(OmahaXMLRequestTest, CreateReturnsValidXML) {
|
| + NSString* requestDTDLocation =
|
| + [[[NSFileManager defaultManager] currentDirectoryPath]
|
| + stringByAppendingString:@"/testing/requestCheck.dtd"];
|
| + NSData* requestDTDData = [NSData dataWithContentsOfFile:requestDTDLocation];
|
| + NSError* error;
|
| + NSXMLDTD* requestXMLChecker =
|
| + [[NSXMLDTD alloc] initWithData:requestDTDData options:0 error:&error];
|
| + [requestXMLChecker setName:@"request"];
|
| + [xml_body_ setDTD:requestXMLChecker];
|
| + EXPECT_TRUE([xml_body_ validateAndReturnError:&error]);
|
| +}
|
| +
|
| +} // namespace
|
|
|