Back to index

unity  6.0.0
test_indicators.cpp
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2012 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Marco Trevisan (TreviƱo) <3v1n0@ubuntu.com>
00018  */
00019 
00020 #include <gmock/gmock.h>
00021 #include <UnityCore/Indicators.h>
00022 #include <UnityCore/AppmenuIndicator.h>
00023 
00024 using namespace std;
00025 using namespace unity;
00026 using namespace indicator;
00027 using namespace testing;
00028 
00029 namespace
00030 {
00031 
00032 struct TargetData
00033 {
00034   TargetData()
00035   {
00036     Reset();
00037   }
00038 
00039   void Reset()
00040   {
00041     entry = "";
00042     geo = nux::Rect();
00043     delta = 0;
00044     x = 0;
00045     y = 0;
00046     xid = 0;
00047     button = 0;
00048     timestamp = 0;
00049   }
00050 
00051   std::string entry;
00052   nux::Rect geo;
00053   int delta;
00054   int x;
00055   int y;
00056   unsigned int xid;
00057   unsigned int button;
00058   unsigned int timestamp;
00059 };
00060 
00061 class MockIndicators : public Indicators
00062 {
00063 public:
00064   MockIndicators()
00065   {}
00066 
00067   // Implementing Indicators virtual functions
00068   virtual void OnEntryScroll(std::string const& entry_id, int delta)
00069   {
00070     target.entry = entry_id;
00071     target.delta = delta;
00072   }
00073 
00074   virtual void OnEntryShowMenu(std::string const& entry_id, unsigned int xid,
00075                                int x, int y, unsigned int button,
00076                                unsigned int timestamp)
00077   {
00078     on_entry_show_menu.emit(entry_id, xid, x, y, button, timestamp);
00079 
00080     target.entry = entry_id;
00081     target.xid = xid;
00082     target.x = x;
00083     target.y = y;
00084     target.button = button;
00085     target.timestamp = timestamp;
00086   }
00087 
00088   virtual void OnEntrySecondaryActivate(std::string const& entry_id,
00089                                         unsigned int timestamp)
00090   {
00091     target.entry = entry_id;
00092     target.timestamp = timestamp;
00093   }
00094 
00095   virtual void OnShowAppMenu(unsigned int xid, int x, int y,
00096                              unsigned int timestamp)
00097   {
00098     on_show_appmenu.emit(xid, x, y, timestamp);
00099 
00100     target.xid = xid;
00101     target.x = x;
00102     target.y = y;
00103     target.timestamp = timestamp;
00104   }
00105 
00106   // Redirecting protected methods
00107   Indicator::Ptr GetIndicator(std::string const& name)
00108   {
00109     return Indicators::GetIndicator(name);
00110   }
00111 
00112   Indicator::Ptr AddIndicator(std::string const& name)
00113   {
00114     return Indicators::AddIndicator(name);
00115   }
00116 
00117   void RemoveIndicator(std::string const& name)
00118   {
00119     Indicators::RemoveIndicator(name);
00120   }
00121 
00122   // Utility function used to fill the class with test indicators with entries
00123   void SetupTestChildren()
00124   {
00125     // Adding an indicator filled with entries into the MockIndicators
00126     Indicator::Entries sync_data;
00127     Entry* entry;
00128 
00129     Indicator::Ptr test_indicator_1 = AddIndicator("indicator-test-1");
00130 
00131     entry = new Entry("indicator-test-1|entry-1", "name-hint-1", "label", true, true,
00132                       0, "icon", true, true, -1);
00133     sync_data.push_back(Entry::Ptr(entry));
00134 
00135     entry = new Entry("indicator-test-1|entry-2", "name-hint-2", "label", true, true,
00136                       0, "icon", true, true, -1);
00137     sync_data.push_back(Entry::Ptr(entry));
00138 
00139     entry = new Entry("indicator-test-1|entry-3", "name-hint-3", "label", true, true,
00140                       0, "icon", true, true, -1);
00141     sync_data.push_back(Entry::Ptr(entry));
00142 
00143     // Sync the indicator, adding 3 entries
00144     test_indicator_1->Sync(sync_data);
00145     EXPECT_EQ(test_indicator_1->GetEntries().size(), 3);
00146 
00147 
00148     // Adding another indicator filled with entries into the MockIndicators
00149     Indicator::Ptr test_indicator_2 = AddIndicator("indicator-test-2");
00150     sync_data.clear();
00151 
00152     entry = new Entry("indicator-test-2|entry-1", "name-hint-1", "label", true, true,
00153                       0, "icon", true, true, -1);
00154     sync_data.push_back(Entry::Ptr(entry));
00155 
00156     entry = new Entry("indicator-test-2|entry-2", "name-hint-2", "label", true, true,
00157                       0, "icon", true, true, -1);
00158     sync_data.push_back(Entry::Ptr(entry));
00159 
00160     // Sync the indicator, adding 2 entries
00161     test_indicator_2->Sync(sync_data);
00162     EXPECT_EQ(test_indicator_2->GetEntries().size(), 2);
00163 
00164     ASSERT_THAT(GetIndicators().size(), 2);
00165   }
00166 
00167   TargetData target;
00168 };
00169 
00170 TEST(TestIndicators, Construction)
00171 {
00172   {
00173     MockIndicators indicators;
00174 
00175     EXPECT_TRUE(indicators.GetIndicators().empty());
00176   }
00177 }
00178 
00179 TEST(TestIndicators, GetInvalidIndicator)
00180 {
00181   MockIndicators indicators;
00182 
00183   ASSERT_THAT(indicators.GetIndicator("no-available-indicator"), IsNull());
00184 }
00185 
00186 TEST(TestIndicators, IndicatorsFactory)
00187 {
00188   MockIndicators indicators;
00189 
00190   Indicator::Ptr standard_indicator = indicators.AddIndicator("libapplication.so");
00191   EXPECT_EQ(standard_indicator->name(), "libapplication.so");
00192   EXPECT_FALSE(standard_indicator->IsAppmenu());
00193 
00194   Indicator::Ptr appmenu_indicator = indicators.AddIndicator("libappmenu.so");
00195   EXPECT_EQ(appmenu_indicator->name(), "libappmenu.so");
00196   EXPECT_TRUE(appmenu_indicator->IsAppmenu());
00197 }
00198 
00199 TEST(TestIndicators, IndicatorsHandling)
00200 {
00201   MockIndicators indicators;
00202   Indicators::IndicatorsList indicators_list;
00203 
00204   // Connecting to signals
00205   Indicators::IndicatorsList added_list;
00206   indicators.on_object_added.connect([&added_list] (Indicator::Ptr const& i) {
00207     added_list.push_back(i);
00208   });
00209 
00210   Indicators::IndicatorsList removed_list;
00211   indicators.on_object_removed.connect([&removed_list] (Indicator::Ptr const& i) {
00212     removed_list.push_back(i);
00213   });
00214 
00215   // Adding some indicators...
00216   Indicator::Ptr test_indicator_1(indicators.AddIndicator("indicator-test-1"));
00217   EXPECT_EQ(indicators.GetIndicator("indicator-test-1"), test_indicator_1);
00218 
00219   EXPECT_EQ(added_list.size(), 1);
00220   EXPECT_NE(std::find(added_list.begin(), added_list.end(), test_indicator_1), added_list.end());
00221   EXPECT_TRUE(removed_list.empty());
00222 
00223   indicators_list = indicators.GetIndicators();
00224   EXPECT_EQ(indicators_list.size(), 1);
00225   EXPECT_NE(std::find(indicators_list.begin(), indicators_list.end(), test_indicator_1), indicators_list.end());
00226 
00227 
00228   Indicator::Ptr test_indicator_2(indicators.AddIndicator("indicator-test-2"));
00229   EXPECT_EQ(indicators.GetIndicator("indicator-test-2"), test_indicator_2);
00230 
00231   EXPECT_EQ(added_list.size(), 2);
00232   EXPECT_NE(std::find(added_list.begin(), added_list.end(), test_indicator_2), added_list.end());
00233   EXPECT_TRUE(removed_list.empty());
00234 
00235   indicators_list = indicators.GetIndicators();
00236   EXPECT_EQ(indicators_list.size(), 2);
00237   EXPECT_NE(std::find(indicators_list.begin(), indicators_list.end(), test_indicator_2), indicators_list.end());
00238 
00239 
00240   Indicator::Ptr test_indicator_3(indicators.AddIndicator("indicator-test-3"));
00241   EXPECT_EQ(indicators.GetIndicator("indicator-test-3"), test_indicator_3);
00242 
00243   EXPECT_EQ(added_list.size(), 3);
00244   EXPECT_NE(std::find(added_list.begin(), added_list.end(), test_indicator_3), added_list.end());
00245   EXPECT_TRUE(removed_list.empty());
00246 
00247   indicators_list = indicators.GetIndicators();
00248   EXPECT_EQ(indicators_list.size(), 3);
00249   EXPECT_NE(std::find(indicators_list.begin(), indicators_list.end(), test_indicator_3), indicators_list.end());
00250 
00251 
00252   ASSERT_THAT(indicators.GetIndicator("invalid-indicator-test-4"), IsNull());
00253   EXPECT_EQ(added_list.size(), 3);
00254   EXPECT_TRUE(removed_list.empty());
00255   EXPECT_EQ(indicators.GetIndicators().size(), 3);
00256 
00257   // Readding an indicator already there should do nothing
00258   Indicator::Ptr test_indicator_3_duplicate(indicators.AddIndicator("indicator-test-3"));
00259   EXPECT_EQ(added_list.size(), 3);
00260   EXPECT_EQ(indicators.GetIndicator("indicator-test-3"), test_indicator_3);
00261   EXPECT_EQ(indicators.GetIndicators().size(), 3);
00262   EXPECT_EQ(test_indicator_3, test_indicator_3_duplicate);
00263 
00264   // Removing the indicators...
00265   added_list.clear();
00266 
00267   indicators.RemoveIndicator("indicator-test-2");
00268   ASSERT_THAT(indicators.GetIndicator("indicator-test-2"), IsNull());
00269 
00270   EXPECT_TRUE(added_list.empty());
00271   EXPECT_NE(std::find(removed_list.begin(), removed_list.end(), test_indicator_2), removed_list.end());
00272   EXPECT_EQ(removed_list.size(), 1);
00273 
00274   indicators_list = indicators.GetIndicators();
00275   EXPECT_EQ(indicators_list.size(), 2);
00276   EXPECT_EQ(std::find(indicators_list.begin(), indicators_list.end(), test_indicator_2), indicators_list.end());
00277 
00278 
00279   indicators.RemoveIndicator("indicator-test-1");
00280   ASSERT_THAT(indicators.GetIndicator("indicator-test-1"), IsNull());
00281 
00282   EXPECT_TRUE(added_list.empty());
00283   EXPECT_NE(std::find(removed_list.begin(), removed_list.end(), test_indicator_1), removed_list.end());
00284   EXPECT_EQ(removed_list.size(), 2);
00285 
00286   indicators_list = indicators.GetIndicators();
00287   EXPECT_EQ(indicators_list.size(), 1);
00288   EXPECT_EQ(std::find(indicators_list.begin(), indicators_list.end(), test_indicator_1), indicators_list.end());
00289 
00290 
00291   indicators.RemoveIndicator("indicator-test-3");
00292   ASSERT_THAT(indicators.GetIndicator("indicator-test-3"), IsNull());
00293 
00294   EXPECT_TRUE(added_list.empty());
00295   EXPECT_NE(std::find(removed_list.begin(), removed_list.end(), test_indicator_3), removed_list.end());
00296   EXPECT_EQ(removed_list.size(), 3);
00297 
00298   indicators_list = indicators.GetIndicators();
00299   EXPECT_TRUE(indicators_list.empty());
00300 
00301 
00302   indicators.RemoveIndicator("invalid-indicator-test-4");
00303   EXPECT_EQ(removed_list.size(), 3);
00304 }
00305 
00306 TEST(TestIndicators, ActivateEntry)
00307 {
00308   MockIndicators indicators;
00309   indicators.SetupTestChildren();
00310 
00311   // Activating Entries from the Indicators class to see if they get updated
00312   TargetData target;
00313 
00314   sigc::connection activated_conn =
00315   indicators.on_entry_activated.connect([&] (std::string const& e, nux::Rect const& g) {
00316     target.entry = e;
00317     target.geo = g;
00318   });
00319 
00320   ASSERT_THAT(indicators.GetIndicator("indicator-test-1"), NotNull());
00321 
00322   Entry::Ptr entry12(indicators.GetIndicator("indicator-test-1")->GetEntry("indicator-test-1|entry-2"));
00323   ASSERT_THAT(entry12, NotNull());
00324 
00325   ASSERT_THAT(entry12->active(), false);
00326   ASSERT_THAT(entry12->geometry(), nux::Rect());
00327 
00328   target.Reset();
00329   indicators.ActivateEntry("indicator-test-1|entry-2", nux::Rect(1, 2, 3, 4));
00330 
00331   EXPECT_EQ(entry12->active(), true);
00332   EXPECT_EQ(entry12->geometry(), nux::Rect(1, 2, 3, 4));
00333   EXPECT_EQ(target.entry, entry12->id());
00334   EXPECT_EQ(target.geo, entry12->geometry());
00335 
00336   activated_conn.disconnect();
00337 }
00338 
00339 TEST(TestIndicators, ActivateEntryShouldDisactivatePrevious)
00340 {
00341   MockIndicators indicators;
00342   indicators.SetupTestChildren();
00343 
00344   // Activating Entries from the Indicators class to see if they get updated
00345   TargetData target;
00346 
00347   sigc::connection activated_conn =
00348   indicators.on_entry_activated.connect([&] (std::string const& e, nux::Rect const& g) {
00349     target.entry = e;
00350     target.geo = g;
00351   });
00352 
00353   ASSERT_THAT(indicators.GetIndicator("indicator-test-2"), NotNull());
00354 
00355   Entry::Ptr entry22(indicators.GetIndicator("indicator-test-2")->GetEntry("indicator-test-2|entry-2"));
00356   ASSERT_THAT(entry22, NotNull());
00357 
00358   ASSERT_THAT(entry22->active(), false);
00359   ASSERT_THAT(entry22->geometry(), nux::Rect());
00360 
00361   indicators.ActivateEntry("indicator-test-2|entry-2", nux::Rect(1, 2, 3, 4));
00362 
00363   ASSERT_THAT(entry22->active(), true);
00364   ASSERT_THAT(entry22->geometry(), nux::Rect(1, 2, 3, 4));
00365 
00366 
00367   // Activating another entry, the previously selected one should be disactivate
00368   Entry::Ptr entry21(indicators.GetIndicator("indicator-test-2")->GetEntry("indicator-test-2|entry-1"));
00369   ASSERT_THAT(entry21, NotNull());
00370 
00371   ASSERT_THAT(entry21->active(), false);
00372   ASSERT_THAT(entry21->geometry(), nux::Rect());
00373 
00374   target.Reset();
00375   indicators.ActivateEntry("indicator-test-2|entry-1", nux::Rect(4, 3, 2, 1));
00376 
00377   EXPECT_EQ(entry22->active(), false);
00378   EXPECT_EQ(entry22->geometry(), nux::Rect());
00379 
00380   EXPECT_EQ(entry21->active(), true);
00381   EXPECT_EQ(entry21->geometry(), nux::Rect(4, 3, 2, 1));
00382   EXPECT_EQ(target.entry, entry21->id());
00383   EXPECT_EQ(target.geo, entry21->geometry());
00384 
00385   activated_conn.disconnect();
00386 }
00387 
00388 TEST(TestIndicators, ActivateEntryInvalidEmitsNullSignal)
00389 {
00390   MockIndicators indicators;
00391   indicators.SetupTestChildren();
00392 
00393   TargetData target;
00394   bool signal_received = false;
00395 
00396   sigc::connection activated_conn =
00397   indicators.on_entry_activated.connect([&] (std::string const& e, nux::Rect const& g) {
00398     signal_received = true;
00399     target.entry = e;
00400     target.geo = g;
00401   });
00402 
00403   ASSERT_THAT(indicators.GetIndicator("indicator-test-1"), NotNull());
00404 
00405   Entry::Ptr entry13(indicators.GetIndicator("indicator-test-1")->GetEntry("indicator-test-1|entry-3"));
00406   ASSERT_THAT(entry13, NotNull());
00407 
00408   ASSERT_THAT(entry13->active(), false);
00409   ASSERT_THAT(entry13->geometry(), nux::Rect());
00410 
00411   indicators.ActivateEntry("indicator-test-1|entry-3", nux::Rect(4, 2, 3, 4));
00412 
00413   ASSERT_THAT(entry13->active(), true);
00414   ASSERT_THAT(entry13->geometry(), nux::Rect(4, 2, 3, 4));
00415   ASSERT_TRUE(signal_received);
00416 
00417 
00418   // Activating invalid entry, the previously selected one should be disactivate
00419   target.Reset();
00420   signal_received = false;
00421   indicators.ActivateEntry("indicator-entry-invalid", nux::Rect(5, 5, 5, 5));
00422   EXPECT_TRUE(target.entry.empty());
00423   EXPECT_EQ(target.geo, nux::Rect());
00424   EXPECT_TRUE(signal_received);
00425 
00426   EXPECT_EQ(entry13->active(), false);
00427   EXPECT_EQ(entry13->geometry(), nux::Rect());
00428 
00429   activated_conn.disconnect();
00430 }
00431 
00432 TEST(TestIndicators, SetEntryShowNow)
00433 {
00434   MockIndicators indicators;
00435   indicators.SetupTestChildren();
00436 
00437   TargetData target;
00438 
00439   sigc::connection activated_conn =
00440   indicators.on_entry_activated.connect([&] (std::string const& e, nux::Rect const& g) {
00441     target.entry = e;
00442     target.geo = g;
00443   });
00444 
00445   ASSERT_THAT(indicators.GetIndicator("indicator-test-2"), NotNull());
00446 
00447   Entry::Ptr entry22(indicators.GetIndicator("indicator-test-2")->GetEntry("indicator-test-2|entry-2"));
00448 
00449   ASSERT_THAT(entry22, NotNull());
00450   ASSERT_THAT(entry22->show_now(), false);
00451 
00452   indicators.SetEntryShowNow("indicator-test-2|entry-2", true);
00453   EXPECT_EQ(entry22->show_now(), true);
00454 
00455   indicators.SetEntryShowNow("indicator-test-2|entry-2", false);
00456   EXPECT_EQ(entry22->show_now(), false);
00457 }
00458 
00459 TEST(TestIndicators, EntryShowMenu)
00460 {
00461   MockIndicators indicators;
00462   indicators.SetupTestChildren();
00463 
00464   // See if the indicators class get notified on entries actions
00465   ASSERT_THAT(indicators.GetIndicator("indicator-test-1"), NotNull());
00466 
00467   Entry::Ptr entry13(indicators.GetIndicator("indicator-test-1")->GetEntry("indicator-test-1|entry-3"));
00468   ASSERT_THAT(entry13, NotNull());
00469 
00470   TargetData show_menu_data;
00471   sigc::connection on_entry_show_menu_conn =
00472   indicators.on_entry_show_menu.connect([&] (std::string const& e, unsigned int w,
00473                                              int x, int y, unsigned int b, unsigned int t) {
00474     show_menu_data.entry = e;
00475     show_menu_data.xid = w;
00476     show_menu_data.x = x;
00477     show_menu_data.y = y;
00478     show_menu_data.button = b;
00479     show_menu_data.timestamp = t;
00480   });
00481 
00482   entry13->ShowMenu(465789, 35, 53, 2, 1331773412);
00483 
00484   EXPECT_EQ(indicators.target.entry, entry13->id());
00485   EXPECT_EQ(indicators.target.xid, 465789);
00486   EXPECT_EQ(indicators.target.x, 35);
00487   EXPECT_EQ(indicators.target.y, 53);
00488   EXPECT_EQ(indicators.target.button, 2);
00489   EXPECT_EQ(indicators.target.timestamp, 1331773412);
00490 
00491   EXPECT_EQ(show_menu_data.entry, entry13->id());
00492   EXPECT_EQ(show_menu_data.xid, 465789);
00493   EXPECT_EQ(show_menu_data.x, 35);
00494   EXPECT_EQ(show_menu_data.y, 53);
00495   EXPECT_EQ(show_menu_data.button, 2);
00496   EXPECT_EQ(show_menu_data.timestamp, 1331773412);
00497 
00498   show_menu_data.Reset();
00499   indicators.target.Reset();
00500 
00501   entry13->ShowMenu(55, 68, 3, 1331773883);
00502 
00503   EXPECT_EQ(indicators.target.entry, entry13->id());
00504   EXPECT_EQ(indicators.target.xid, 0);
00505   EXPECT_EQ(indicators.target.x, 55);
00506   EXPECT_EQ(indicators.target.y, 68);
00507   EXPECT_EQ(indicators.target.button, 3);
00508   EXPECT_EQ(indicators.target.timestamp, 1331773883);
00509 
00510   EXPECT_EQ(show_menu_data.entry, entry13->id());
00511   EXPECT_EQ(show_menu_data.xid, 0);
00512   EXPECT_EQ(show_menu_data.x, 55);
00513   EXPECT_EQ(show_menu_data.y, 68);
00514   EXPECT_EQ(show_menu_data.button, 3);
00515   EXPECT_EQ(show_menu_data.timestamp, 1331773883);
00516 
00517   on_entry_show_menu_conn.disconnect();
00518 }
00519 
00520 TEST(TestIndicators, EntryScroll)
00521 {
00522   MockIndicators indicators;
00523   indicators.SetupTestChildren();
00524 
00525   // See if the indicators class get notified on entries actions
00526   ASSERT_THAT(indicators.GetIndicator("indicator-test-1"), NotNull());
00527 
00528   Entry::Ptr entry11(indicators.GetIndicator("indicator-test-1")->GetEntry("indicator-test-1|entry-1"));
00529   ASSERT_THAT(entry11, NotNull());
00530 
00531   entry11->Scroll(80);
00532   EXPECT_EQ(indicators.target.entry, entry11->id());
00533   EXPECT_EQ(indicators.target.delta, 80);
00534 
00535   entry11->SecondaryActivate(1331774167);
00536   EXPECT_EQ(indicators.target.entry, entry11->id());
00537   EXPECT_EQ(indicators.target.timestamp, 1331774167);
00538 }
00539 
00540 TEST(TestIndicators, EntrySecondaryActivate)
00541 {
00542   MockIndicators indicators;
00543   indicators.SetupTestChildren();
00544 
00545   // See if the indicators class get notified on entries actions
00546   ASSERT_THAT(indicators.GetIndicator("indicator-test-2"), NotNull());
00547 
00548   Entry::Ptr entry22(indicators.GetIndicator("indicator-test-2")->GetEntry("indicator-test-2|entry-1"));
00549   ASSERT_THAT(entry22, NotNull());
00550 
00551   entry22->SecondaryActivate(1331774167);
00552   EXPECT_EQ(indicators.target.entry, entry22->id());
00553   EXPECT_EQ(indicators.target.timestamp, 1331774167);
00554 }
00555 
00556 TEST(TestIndicators, ShowAppMenu)
00557 {
00558   MockIndicators indicators;
00559 
00560   {
00561     Indicator::Ptr appmenu_indicator = indicators.AddIndicator("libappmenu.so");
00562     ASSERT_TRUE(appmenu_indicator->IsAppmenu());
00563   }
00564 
00565   ASSERT_EQ(indicators.GetIndicators().size(), 1);
00566 
00567   {
00568     Indicator::Ptr indicator = indicators.GetIndicator("libappmenu.so");
00569     ASSERT_THAT(indicator, NotNull());
00570     auto appmenu_indicator = dynamic_cast<AppmenuIndicator*>(indicator.get());
00571     ASSERT_THAT(appmenu_indicator, NotNull());
00572 
00573     indicators.target.Reset();
00574 
00575     appmenu_indicator->ShowAppmenu(4356789, 54, 13, 1331774961);
00576 
00577     EXPECT_TRUE(indicators.target.entry.empty());
00578     EXPECT_EQ(indicators.target.xid, 4356789);
00579     EXPECT_EQ(indicators.target.x, 54);
00580     EXPECT_EQ(indicators.target.y, 13);
00581     EXPECT_EQ(indicators.target.button, 0);
00582     EXPECT_EQ(indicators.target.timestamp, 1331774961);
00583   }
00584 }
00585 
00586 }