~unity-team/unity/trunk

« back to all changes in this revision

Viewing changes to tests/test_application_launcher_icon.cpp

ApplicationLauncherIcon: re-open a new instance of the filemanager if only the trash/device is open. Fixes: https://bugs.launchpad.net/bugs/753938.

Approved by PS Jenkins bot, Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
  {}
51
51
 
52
52
  MOCK_METHOD1(ActivateLauncherIcon, void(ActionArg));
 
53
 
 
54
  using ApplicationLauncherIcon::IsFileManager;
53
55
};
54
56
 
55
57
MATCHER_P(AreArgsEqual, a, "")
487
489
  EXPECT_TRUE(method_called);
488
490
}
489
491
 
 
492
TEST_F(TestApplicationLauncherIcon, IsFileManager)
 
493
{
 
494
  EXPECT_FALSE(usc_icon->IsFileManager());
 
495
  EXPECT_FALSE(empty_icon->IsFileManager());
 
496
  EXPECT_FALSE(mock_icon->IsFileManager());
 
497
 
 
498
  auto app = std::make_shared<MockApplication>("/any/path/nautilus.desktop", "Nautilus");
 
499
  nux::ObjectPtr<MockApplicationLauncherIcon> icon(new NiceMock<MockApplicationLauncherIcon>(app));
 
500
  EXPECT_TRUE(icon->IsFileManager());
 
501
 
 
502
  app = std::make_shared<MockApplication>("/any/path/nautilus-folder-handler.desktop", "Nautilus");
 
503
  icon = new NiceMock<MockApplicationLauncherIcon>(app);
 
504
  EXPECT_TRUE(icon->IsFileManager());
 
505
 
 
506
  app = std::make_shared<MockApplication>("/any/path/nautilus-home.desktop", "Nautilus");
 
507
  icon = new NiceMock<MockApplicationLauncherIcon>(app);
 
508
  EXPECT_TRUE(icon->IsFileManager());
 
509
}
 
510
 
490
511
}