Unregister from GCM when the only GCM app is removed
[chromium-blink-merge.git] / chrome / renderer / media / cast_session_browsertest.cc
blobc9b0c43670573b9659e2f354937cd1ec7b6c78a2
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.
5 #include "chrome/renderer/media/cast_session.h"
7 #include "base/message_loop/message_loop_proxy.h"
8 #include "base/run_loop.h"
9 #include "chrome/renderer/chrome_content_renderer_client.h"
10 #include "chrome/test/base/chrome_render_view_test.h"
12 namespace chrome {
14 typedef ChromeRenderViewTest CastSessionBrowserTest;
16 // Tests that CastSession is created and destroyed properly inside
17 // chrome renderer.
18 TEST_F(CastSessionBrowserTest, CreateAndDestroy) {
19 chrome_render_thread_->set_io_message_loop_proxy(
20 base::MessageLoopProxy::current());
21 ChromeContentRendererClient* client =
22 static_cast<ChromeContentRendererClient*>(content_renderer_client_.get());
23 client->RenderThreadStarted();
25 scoped_refptr<CastSession> session(new CastSession());
27 // Causes CastSession to destruct.
28 session = NULL;
29 base::RunLoop().RunUntilIdle();
32 } // namespace chrome