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

Unified Diff: chrome/installer/mac/app/testing/OmahaXMLRequest_test.mm

Issue 2137743002: Added test files for SystemInfo.m and OmahaXMLRequest.m. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some copyright content to please the trybot lords Created 4 years, 5 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 | « chrome/installer/mac/app/BUILD.gn ('k') | chrome/installer/mac/app/testing/SystemInfo_test.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a0f285ef7cc94dd0c5d7fd28796790d541c889f2
--- /dev/null
+++ b/chrome/installer/mac/app/testing/OmahaXMLRequest_test.mm
@@ -0,0 +1,33 @@
+// 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 "chrome/installer/mac/app/OmahaXMLRequest.h"
+
+#include "base/mac/scoped_nsobject.h"
+#include "base/macros.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+TEST(OmahaXMLRequestTest, CreateReturnsValidXML) {
+ base::scoped_nsobject<NSXMLDocument> xml_body_(
+ [OmahaXMLRequest createXMLRequestBody]);
+ ASSERT_TRUE(xml_body_);
+
+ NSString* requestDTDLocation = [[[[NSBundle mainBundle] bundlePath]
+ stringByAppendingPathComponent:
+ @"../../chrome/installer/mac/app/testing/requestCheck.dtd"]
+ stringByResolvingSymlinksInPath];
+ NSData* requestDTDData = [NSData dataWithContentsOfFile:requestDTDLocation];
+ ASSERT_TRUE(requestDTDData);
+
+ 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
« no previous file with comments | « chrome/installer/mac/app/BUILD.gn ('k') | chrome/installer/mac/app/testing/SystemInfo_test.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698