~brandontschaefer/unity/lp.1157329-fix

« back to all changes in this revision

Viewing changes to tests/test_volume_imp.cpp

  • Committer: Tarmac
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2013-03-14 02:11:49 UTC
  • mfrom: (3212.1.2 volumes-open-timestamp)
  • Revision ID: tarmac-20130314021149-m5ppa1g21dzr96kx
FileManagerOpener: pass the timestamp to the Open method and set to context

MountAndOpenInFileManager now needs a timestamp to open the file manager,
that we pass to the target using the application launch context.
This value is got from the ActionArg or from the quicklists event. Fixes: https://bugs.launchpad.net/bugs/1154792.

Approved by PS Jenkins bot, Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
public:
37
37
  typedef std::shared_ptr<MockFileManagerOpener> Ptr;
38
38
 
39
 
  MOCK_METHOD1(Open, void(std::string const& uri));
 
39
  MOCK_METHOD2(Open, void(std::string const& uri, unsigned long long time));
40
40
};
41
41
 
42
42
class MockDeviceNotificationDisplay : public launcher::DeviceNotificationDisplay
128
128
 
129
129
TEST_F(TestVolumeImp, TestMountAndOpenInFileManager)
130
130
{
131
 
  EXPECT_CALL(*file_manager_opener_, Open(ROOT_FILE_URI))
132
 
      .Times(1);
 
131
  unsigned long long time = g_random_int();
 
132
  EXPECT_CALL(*file_manager_opener_, Open(ROOT_FILE_URI, time));
133
133
 
134
 
  volume_->MountAndOpenInFileManager();
 
134
  volume_->MountAndOpenInFileManager(time);
135
135
  EXPECT_EQ(g_mock_volume_last_mount_had_mount_operation(gvolume_), TRUE);
136
136
  EXPECT_TRUE(volume_->IsMounted());
137
137
 
138
 
  EXPECT_CALL(*file_manager_opener_, Open(ROOT_FILE_URI))
139
 
      .Times(1);
 
138
  time = g_random_int();
 
139
  EXPECT_CALL(*file_manager_opener_, Open(ROOT_FILE_URI, time));
140
140
 
141
 
  volume_->MountAndOpenInFileManager();
 
141
  volume_->MountAndOpenInFileManager(time);
142
142
  EXPECT_EQ(g_mock_volume_last_mount_had_mount_operation(gvolume_), TRUE);
143
143
  EXPECT_TRUE(volume_->IsMounted());
144
144
}