1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/renderer/media/cast_session.h" 6 7 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/run_loop.h" 9 #include "chrome/test/base/chrome_render_view_test.h" 10 11 namespace chrome { 12 13 typedef ChromeRenderViewTest CastSessionBrowserTest; 14 15 // Tests that CastSession is created and destroyed properly inside 16 // chrome renderer. TEST_F(CastSessionBrowserTest,CreateAndDestroy)17TEST_F(CastSessionBrowserTest, CreateAndDestroy) { 18 chrome_content_renderer_client_.RenderThreadStarted(); 19 chrome_render_thread_->set_io_message_loop_proxy( 20 base::MessageLoopProxy::current()); 21 22 scoped_refptr<CastSession> session(new CastSession()); 23 24 // Causes CastSession to destruct. 25 session = NULL; 26 base::RunLoop().RunUntilIdle(); 27 } 28 29 } // namespace chrome 30