OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 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 #import <CoreLocation/CoreLocation.h> | |
sdefresne
2015/04/28 08:34:39
style: newline after this #include
| |
6 #import "ios/chrome/browser/geolocation/CLLocation+XGeoHeader.h" | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 namespace { | |
10 | |
11 NSString* const kEncoded550BatterySt = | |
12 @"a cm9sZTogQ1VSUkVOVF9MT0NBVElPTgpwcm9kdWNlcjogREVWSUNFX0xPQ0FUSU9OCnRpbWV" | |
13 "zdGFtcDogMTM4OTAwMDAwMDAwMDAwMApyYWRpdXM6IDEwMDAwCmxhdGxuZyA8CiAgbGF0aXR1" | |
14 "ZGVfZTc6IDM3Nzk2MzIyMAogIGxvbmdpdHVkZV9lNzogLTEyMjQwMDI5MTAKPg=="; | |
15 | |
16 TEST(CLLocationXGeoHeaderTest, TestXGeoString) { | |
17 CLLocationCoordinate2D coordinate = | |
18 CLLocationCoordinate2DMake(37.796322, -122.400291); | |
19 // Picked a fixed timestamp. This one is 2014-01-06 09:20:00 +0000. | |
20 NSDate* timestamp = [NSDate dateWithTimeIntervalSince1970:1389000000]; | |
21 CLLocation* location = | |
22 [[[CLLocation alloc] initWithCoordinate:coordinate | |
23 altitude:0 | |
24 horizontalAccuracy:10 | |
25 verticalAccuracy:100 | |
26 course:0 | |
27 speed:0 | |
28 timestamp:timestamp] autorelease]; | |
29 NSString* xGeoString = [location cr_xGeoString]; | |
30 EXPECT_TRUE([xGeoString isEqualToString:kEncoded550BatterySt]); | |
31 } | |
32 | |
33 } // namespace | |
OLD | NEW |