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

Side by Side Diff: base/ios/device_util_unittest.mm

Issue 349453002: Remove IsRunningOnIOS6OrLater (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « base/ios/device_util.mm ('k') | base/ios/ios_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <UIKit/UIKit.h> 5 #import <UIKit/UIKit.h>
6 6
7 #include "base/ios/device_util.h" 7 #include "base/ios/device_util.h"
8 #include "base/ios/ios_util.h" 8 #include "base/ios/ios_util.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 TEST_F(DeviceUtilTest, GetDeviceIdentifier) { 45 TEST_F(DeviceUtilTest, GetDeviceIdentifier) {
46 CleanNSUserDefaultsForDeviceId(); 46 CleanNSUserDefaultsForDeviceId();
47 47
48 std::string default_id = ios::device_util::GetDeviceIdentifier(NULL); 48 std::string default_id = ios::device_util::GetDeviceIdentifier(NULL);
49 std::string other_id = ios::device_util::GetDeviceIdentifier("ForTest"); 49 std::string other_id = ios::device_util::GetDeviceIdentifier("ForTest");
50 EXPECT_NE(default_id, other_id); 50 EXPECT_NE(default_id, other_id);
51 51
52 CleanNSUserDefaultsForDeviceId(); 52 CleanNSUserDefaultsForDeviceId();
53 53
54 std::string new_default_id = ios::device_util::GetDeviceIdentifier(NULL); 54 std::string new_default_id = ios::device_util::GetDeviceIdentifier(NULL);
55 if (base::ios::IsRunningOnIOS6OrLater() && 55 if (![[[[UIDevice currentDevice] identifierForVendor] UUIDString]
56 ![[[[UIDevice currentDevice] identifierForVendor] UUIDString]
57 isEqualToString:@"00000000-0000-0000-0000-000000000000"]) { 56 isEqualToString:@"00000000-0000-0000-0000-000000000000"]) {
58 EXPECT_EQ(default_id, new_default_id); 57 EXPECT_EQ(default_id, new_default_id);
59 } else { 58 } else {
60 EXPECT_NE(default_id, new_default_id); 59 EXPECT_NE(default_id, new_default_id);
61 } 60 }
62 61
63 CleanNSUserDefaultsForDeviceId(); 62 CleanNSUserDefaultsForDeviceId();
64 } 63 }
65 64
66 TEST_F(DeviceUtilTest, CheckMigration) { 65 TEST_F(DeviceUtilTest, CheckMigration) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 std::string base_id = ios::device_util::GetDeviceIdentifier(NULL); 135 std::string base_id = ios::device_util::GetDeviceIdentifier(NULL);
137 [defaults setObject:@"Foo" forKey:@"ClientIDGenerationHardwareType"]; 136 [defaults setObject:@"Foo" forKey:@"ClientIDGenerationHardwareType"];
138 [defaults synchronize]; 137 [defaults synchronize];
139 std::string new_id = ios::device_util::GetDeviceIdentifier(NULL); 138 std::string new_id = ios::device_util::GetDeviceIdentifier(NULL);
140 EXPECT_NE(new_id, base_id); 139 EXPECT_NE(new_id, base_id);
141 140
142 CleanNSUserDefaultsForDeviceId(); 141 CleanNSUserDefaultsForDeviceId();
143 } 142 }
144 143
145 } // namespace 144 } // namespace
OLDNEW
« no previous file with comments | « base/ios/device_util.mm ('k') | base/ios/ios_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698