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-19 12:11:28 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 12:11:28 +0000
commit58c321dd57a1fc00c2c51b0a8b6e547fdf32aa74 (patch)
treecdd273a38ba1b449952d5701e6ceb6f46142c073 /chrome/common/common_param_traits_unittest.cc
parent2375d294b30e5d0b0bc63d26a417203959ef32af (diff)
downloadchromium_src-58c321dd57a1fc00c2c51b0a8b6e547fdf32aa74.zip
chromium_src-58c321dd57a1fc00c2c51b0a8b6e547fdf32aa74.tar.gz
chromium_src-58c321dd57a1fc00c2c51b0a8b6e547fdf32aa74.tar.bz2
Second try for:
http://src.chromium.org/viewvc/chrome?view=rev&revision=39374 Initial Geolocation implementation Adds IPC plumbing. Adds Infobar buttons for requesting permission This change specifically: ui_test_utils::WaitForAppModalDialog registers for listening to notifications too late, i.e., after the dialog had been triggered. Exposes AppModalDialogObserver so that we can register, trigger the dialog, then wait for it. Review URL: http://codereview.chromium.org/647048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39435 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());
+}