| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/test/media_router/media_router_e2e_browsertest.h" | 5 #include "chrome/test/media_router/media_router_e2e_browsertest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/media/router/media_router.h" | 9 #include "chrome/browser/media/router/media_router.h" |
| 10 #include "chrome/browser/media/router/media_router_factory.h" | 10 #include "chrome/browser/media/router/media_router_factory.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 DCHECK(media_router_); | 57 DCHECK(media_router_); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void MediaRouterE2EBrowserTest::TearDownOnMainThread() { | 60 void MediaRouterE2EBrowserTest::TearDownOnMainThread() { |
| 61 MediaRouterBaseBrowserTest::TearDownOnMainThread(); | 61 MediaRouterBaseBrowserTest::TearDownOnMainThread(); |
| 62 media_router_ = nullptr; | 62 media_router_ = nullptr; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void MediaRouterE2EBrowserTest::OnRouteResponseReceived( | 65 void MediaRouterE2EBrowserTest::OnRouteResponseReceived( |
| 66 const MediaRoute* route, | 66 const MediaRoute* route, |
| 67 const std::string& presentation_id, |
| 67 const std::string& error) { | 68 const std::string& error) { |
| 68 ASSERT_TRUE(route); | 69 ASSERT_TRUE(route); |
| 69 route_id_ = route->media_route_id(); | 70 route_id_ = route->media_route_id(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 void MediaRouterE2EBrowserTest::CreateMediaRoute(const MediaSource& source, | 73 void MediaRouterE2EBrowserTest::CreateMediaRoute(const MediaSource& source, |
| 73 const GURL& origin, | 74 const GURL& origin, |
| 74 int tab_id) { | 75 int tab_id) { |
| 75 DCHECK(media_router_); | 76 DCHECK(media_router_); |
| 76 observer_.reset(new TestMediaSinksObserver(media_router_, source)); | 77 observer_.reset(new TestMediaSinksObserver(media_router_, source)); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 CreateMediaRoute(MediaSourceForPresentationUrl(kCastAppPresentationUrl), | 152 CreateMediaRoute(MediaSourceForPresentationUrl(kCastAppPresentationUrl), |
| 152 GURL("http://origin/"), kInvalidTabId); | 153 GURL("http://origin/"), kInvalidTabId); |
| 153 Wait(base::TimeDelta::FromSeconds(30)); | 154 Wait(base::TimeDelta::FromSeconds(30)); |
| 154 | 155 |
| 155 // Wait for 10 seconds to make sure route has been stopped. | 156 // Wait for 10 seconds to make sure route has been stopped. |
| 156 StopMediaRoute(); | 157 StopMediaRoute(); |
| 157 Wait(base::TimeDelta::FromSeconds(10)); | 158 Wait(base::TimeDelta::FromSeconds(10)); |
| 158 } | 159 } |
| 159 | 160 |
| 160 } // namespace media_router | 161 } // namespace media_router |
| OLD | NEW |