diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-13 20:26:11 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-13 20:26:11 +0000 |
commit | b01b30641643b4d4f2ddb35e4c6e3f52418737d2 (patch) | |
tree | d21ab1cc082318fe81ad53dd3db2b378f784aaa2 /remoting | |
parent | e0709e1647c0b8394793bdd23f690c5c81333795 (diff) | |
download | chromium_src-b01b30641643b4d4f2ddb35e4c6e3f52418737d2.zip chromium_src-b01b30641643b4d4f2ddb35e4c6e3f52418737d2.tar.gz chromium_src-b01b30641643b4d4f2ddb35e4c6e3f52418737d2.tar.bz2 |
[remoting_unittests] Moving the variable used to mock VideoFrameCapturer::size_most_recent() to the test class scope so it is availabe in TearDown() while running the outstanding tasks.
This CL also:
- removes the corresponding memcheck supression;
- DCHECKs that the host has been properly deleted by ChromotingHostTest.* tests before reaching TearDown(). This should help to avoid memory leaks similar to ones that were fixed by r156494.
BUG=148828,148883
TEST=remoting_unittests
Review URL: https://codereview.chromium.org/10915264
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/chromoting_host_unittest.cc | 5 | ||||
-rw-r--r-- | remoting/host/client_session_unittest.cc | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc index a380d8d..ae1687c 100644 --- a/remoting/host/chromoting_host_unittest.cc +++ b/remoting/host/chromoting_host_unittest.cc @@ -260,6 +260,11 @@ class ChromotingHostTest : public testing::Test { get_client(connection_index) = client; } + virtual void TearDown() OVERRIDE { + // Make sure that the host has been properly deleted. + DCHECK(host_.get() == NULL); + } + // Change the session route for |client1_|. void ChangeSessionRoute(const std::string& channel_name, const protocol::TransportRoute& route) { diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc index f098a18..6192705 100644 --- a/remoting/host/client_session_unittest.cc +++ b/remoting/host/client_session_unittest.cc @@ -68,9 +68,9 @@ class ClientSessionTest : public testing::Test { scoped_ptr<VideoFrameCapturer>(capturer_))); // Set up a large default screen size that won't affect most tests. - default_screen_size_.set(1000, 1000); + screen_size_.set(1000, 1000); EXPECT_CALL(*capturer_, size_most_recent()) - .WillRepeatedly(ReturnRef(default_screen_size_)); + .WillRepeatedly(ReturnRef(screen_size_)); session_config_ = SessionConfig::GetDefault(); @@ -126,7 +126,7 @@ class ClientSessionTest : public testing::Test { MessageLoop message_loop_; scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; MockChromotingHostContext context_; - SkISize default_screen_size_; + SkISize screen_size_; std::string client_jid_; MockHostStub host_stub_; MockEventExecutor* event_executor_; @@ -324,9 +324,7 @@ TEST_F(ClientSessionTest, RestoreEventState) { } TEST_F(ClientSessionTest, ClampMouseEvents) { - SkISize screen(SkISize::Make(200, 100)); - EXPECT_CALL(*capturer_, size_most_recent()) - .WillRepeatedly(ReturnRef(screen)); + screen_size_.set(200, 100); EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_)); EXPECT_CALL(*event_executor_, StartPtr(_)); |