summaryrefslogtreecommitdiffstats
path: root/chrome/common/common_param_traits_unittest.cc
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 16:44:22 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 16:44:22 +0000
commit434afdcf94e2319ff03872db312d489a44637508 (patch)
tree3414ee5da70cb7ada1074c36cfc001e4ebfd5438 /chrome/common/common_param_traits_unittest.cc
parentf01e0a37fa8f328b8694c9abc69ecc62fbc9690a (diff)
downloadchromium_src-434afdcf94e2319ff03872db312d489a44637508.zip
chromium_src-434afdcf94e2319ff03872db312d489a44637508.tar.gz
chromium_src-434afdcf94e2319ff03872db312d489a44637508.tar.bz2
Initial Geolocation implementation
Adds IPC plumbing. Adds Infobar buttons for requesting permission TEST=geolocation_browsertest.cc Review URL: http://codereview.chromium.org/548188 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/common_param_traits_unittest.cc')
-rw-r--r--chrome/common/common_param_traits_unittest.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/chrome/common/common_param_traits_unittest.cc b/chrome/common/common_param_traits_unittest.cc
index f5db121..d888084 100644
--- a/chrome/common/common_param_traits_unittest.cc
+++ b/chrome/common/common_param_traits_unittest.cc
@@ -166,3 +166,42 @@ TEST(IPCMessageTest, DictionaryValue) {
iter = NULL;
EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output));
}
+
+TEST(IPCMessageTest, Geoposition) {
+ Geoposition input;
+ input.latitude = 0.1;
+ input.longitude = 51.3;
+ input.accuracy = 13.7;
+ input.altitude = 42.24;
+ input.altitude_accuracy = 9.3;
+ input.speed = 55;
+ input.heading = 120;
+ input.timestamp = 1977;
+ input.error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE;
+ input.error_message = L"unittest error message for geoposition";
+
+ IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
+ IPC::WriteParam(&msg, input);
+
+ Geoposition output;
+ void* iter = NULL;
+ EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output));
+ EXPECT_EQ(input.altitude, output.altitude);
+ EXPECT_EQ(input.altitude_accuracy, output.altitude_accuracy);
+ EXPECT_EQ(input.latitude, output.latitude);
+ EXPECT_EQ(input.longitude, output.longitude);
+ EXPECT_EQ(input.accuracy, output.accuracy);
+ EXPECT_EQ(input.heading, output.heading);
+ EXPECT_EQ(input.speed, output.speed);
+ EXPECT_EQ(input.error_code, output.error_code);
+ EXPECT_EQ(input.error_message, output.error_message);
+
+ std::wstring log_message;
+ IPC::LogParam(output, &log_message);
+ EXPECT_STREQ(L"<Geoposition>"
+ L"0.100000 51.300000 13.700000 42.240000 "
+ L"9.300000 55.000000 120.000000 "
+ L"1977 unittest error message for geoposition"
+ L"<Geoposition::ErrorCode>2",
+ log_message.c_str());
+}