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

Unified Diff: chrome/installer/mac/app/testing/SystemInfo_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
Index: chrome/installer/mac/app/testing/SystemInfo_test.mm
diff --git a/chrome/installer/mac/app/testing/SystemInfo_test.mm b/chrome/installer/mac/app/testing/SystemInfo_test.mm
new file mode 100644
index 0000000000000000000000000000000000000000..b12ca34a8c52ce98e7dcca682df50c6068a15b37
--- /dev/null
+++ b/chrome/installer/mac/app/testing/SystemInfo_test.mm
@@ -0,0 +1,32 @@
+// 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/SystemInfo.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+TEST(SystemInfoTest, GetArchReturnsExpectedString) {
+ NSString* arch = [SystemInfo getArch];
+
+ EXPECT_TRUE([arch isEqualToString:@"i486"] ||
+ [arch isEqualToString:@"x86_64h"]);
+}
+
+TEST(SystemInfoTest, GetOSVersionMatchesRegexFormat) {
+ NSString* os_version = [SystemInfo getOSVersion];
+
+ NSRegularExpression* regex = [NSRegularExpression
+ regularExpressionWithPattern:@"^10\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
+ options:0
+ error:nil];
+ NSUInteger matches =
+ [regex numberOfMatchesInString:os_version
+ options:0
+ range:NSMakeRange(0, os_version.length)];
+ EXPECT_EQ(1u, matches);
+}
+
+} // namespace
« no previous file with comments | « chrome/installer/mac/app/testing/OmahaXMLRequest_test.mm ('k') | chrome/installer/mac/app/testing/requestCheck.dtd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698