diff options
| author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2013-03-14 05:22:19 +0000 |
|---|---|---|
| committer | Tarmac <> | 2013-03-14 05:22:19 +0000 |
| commit | c3c977d8a1a5da16fa074dcd152f6000c2e9cc81 (patch) | |
| tree | ec574d3157dead4971517ab34c58d03eeb647931 /tests | |
| parent | 24c99f2a11eab98be720c4d4d8b2952c49a9dde0 (diff) | |
| parent | f75a7639362c009176dd794e86a0de17cfd5d2ea (diff) | |
TrashLauncherIcon: use FileManagerOpener to open it with correct event timestamp. Fixes: https://bugs.launchpad.net/bugs/1154862.
Approved by PS Jenkins bot, Brandon Schaefer. (bzr r3215)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_trash_launcher_icon.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/test_trash_launcher_icon.cpp b/tests/test_trash_launcher_icon.cpp index dc91ee489..e5e4ff342 100644 --- a/tests/test_trash_launcher_icon.cpp +++ b/tests/test_trash_launcher_icon.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012 Canonical Ltd. + * Copyright 2012-2013 Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -26,8 +26,19 @@ using namespace unity::launcher; namespace { +struct MockFileManagerOpener : launcher::FileManagerOpener +{ + MOCK_METHOD2(Open, void(std::string const& uri, unsigned long long time)); +}; + struct TestTrashLauncherIcon : testing::Test { + TestTrashLauncherIcon() + : fmo_(std::make_shared<MockFileManagerOpener>()) + , icon(fmo_) + {} + + std::shared_ptr<MockFileManagerOpener> fmo_; TrashLauncherIcon icon; }; @@ -36,4 +47,11 @@ TEST_F(TestTrashLauncherIcon, Position) EXPECT_EQ(icon.position(), AbstractLauncherIcon::Position::END); } +TEST_F(TestTrashLauncherIcon, Activate) +{ + unsigned long long time = g_random_int(); + EXPECT_CALL(*fmo_, Open("trash:///", time)); + icon.Activate(ActionArg(ActionArg::Source::LAUNCHER, 0, time)); +} + } |
