Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/mac/scoped_nsobject.h" | |
| 6 #include "base/macros.h" | |
| 7 #include "testing/gtest/include/gtest/gtest.h" | |
| 8 | |
| 9 #import "chrome/installer/mac/app/OmahaXMLRequest.h" | |
|
Mark Mentovai
2016/07/22 18:03:24
This should be the _first_ #import in the file. Wh
| |
| 10 | |
| 11 namespace { | |
| 12 | |
| 13 TEST(OmahaXMLRequestTest, CreateReturnsValidXML) { | |
| 14 base::scoped_nsobject<NSXMLDocument> xml_body_( | |
| 15 [OmahaXMLRequest createXMLRequestBody]); | |
| 16 ASSERT_TRUE(xml_body_); | |
| 17 | |
| 18 NSString* requestDTDLocation = | |
| 19 [[[NSFileManager defaultManager] currentDirectoryPath] | |
| 20 stringByAppendingString:@"/testing/requestCheck.dtd"]; | |
| 21 NSData* requestDTDData = [NSData dataWithContentsOfFile:requestDTDLocation]; | |
| 22 NSError* error; | |
| 23 NSXMLDTD* requestXMLChecker = | |
| 24 [[NSXMLDTD alloc] initWithData:requestDTDData options:0 error:&error]; | |
| 25 [requestXMLChecker setName:@"request"]; | |
| 26 [xml_body_ setDTD:requestXMLChecker]; | |
| 27 EXPECT_TRUE([xml_body_ validateAndReturnError:&error]); | |
| 28 } | |
| 29 | |
| 30 } // namespace | |
| OLD | NEW |