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

Side by Side 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: Eliminated fixtures 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 unified diff | Download patch
OLDNEW
(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 "testing/gtest/include/gtest/gtest.h"
6
7 #import "chrome/installer/mac/app/SystemInfo.h"
Mark Mentovai 2016/07/22 18:03:24 Likewise.
8
9 namespace {
10
11 TEST(SystemInfoTest, GetArchReturnsExpectedString) {
12 NSString* arch = [SystemInfo getArch];
13
14 EXPECT_TRUE([arch isEqualToString:@"i486"] ||
15 [arch isEqualToString:@"x86_64h"]);
16 }
17
18 TEST(SystemInfoTest, GetOSVersionMatchesRegexFormat) {
19 NSString* os_version = [SystemInfo getOSVersion];
20
21 NSRegularExpression* regex = [NSRegularExpression
22 regularExpressionWithPattern:@"^10\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
23 options:0
24 error:nil];
25 NSUInteger matches =
26 [regex numberOfMatchesInString:os_version
27 options:0
28 range:NSMakeRange(0, os_version.length)];
29 EXPECT_EQ(1u, matches);
30 }
31
32 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698