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

Unified Diff: ios/chrome/browser/geolocation/CLLocation+XGeoHeaderTest.mm

Issue 1103293002: [iOS] Upstream iOS geolocation code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 8 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: ios/chrome/browser/geolocation/CLLocation+XGeoHeaderTest.mm
diff --git a/ios/chrome/browser/geolocation/CLLocation+XGeoHeaderTest.mm b/ios/chrome/browser/geolocation/CLLocation+XGeoHeaderTest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..a18a7a5fc8e48d3788ef2936a24e97d15c61df6a
--- /dev/null
+++ b/ios/chrome/browser/geolocation/CLLocation+XGeoHeaderTest.mm
@@ -0,0 +1,34 @@
+// Copyright 2013 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 <CoreLocation/CoreLocation.h>
+
+#import "ios/chrome/browser/geolocation/CLLocation+XGeoHeader.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+NSString* const kEncoded550BatterySt =
+ @"a cm9sZTogQ1VSUkVOVF9MT0NBVElPTgpwcm9kdWNlcjogREVWSUNFX0xPQ0FUSU9OCnRpbWV"
+ "zdGFtcDogMTM4OTAwMDAwMDAwMDAwMApyYWRpdXM6IDEwMDAwCmxhdGxuZyA8CiAgbGF0aXR1"
+ "ZGVfZTc6IDM3Nzk2MzIyMAogIGxvbmdpdHVkZV9lNzogLTEyMjQwMDI5MTAKPg==";
+
+TEST(CLLocationXGeoHeaderTest, TestXGeoString) {
+ CLLocationCoordinate2D coordinate =
+ CLLocationCoordinate2DMake(37.796322, -122.400291);
+ // Picked a fixed timestamp. This one is 2014-01-06 09:20:00 +0000.
+ NSDate* timestamp = [NSDate dateWithTimeIntervalSince1970:1389000000];
+ CLLocation* location =
+ [[[CLLocation alloc] initWithCoordinate:coordinate
+ altitude:0
+ horizontalAccuracy:10
+ verticalAccuracy:100
+ course:0
+ speed:0
+ timestamp:timestamp] autorelease];
+ NSString* xGeoString = [location cr_xGeoString];
+ EXPECT_TRUE([xGeoString isEqualToString:kEncoded550BatterySt]);
+}
+
+} // namespace
« no previous file with comments | « ios/chrome/browser/geolocation/CLLocation+XGeoHeader.mm ('k') | ios/chrome/browser/geolocation/location_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698