| 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 <vector> | 7 #include <vector> |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 const std::string& error) { | 76 const std::string& error) { |
| 77 ASSERT_TRUE(route); | 77 ASSERT_TRUE(route); |
| 78 route_id_ = route->media_route_id(); | 78 route_id_ = route->media_route_id(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void MediaRouterE2EBrowserTest::CreateMediaRoute( | 81 void MediaRouterE2EBrowserTest::CreateMediaRoute( |
| 82 const MediaSource& source, | 82 const MediaSource& source, |
| 83 const GURL& origin, | 83 const GURL& origin, |
| 84 content::WebContents* web_contents) { | 84 content::WebContents* web_contents) { |
| 85 DCHECK(media_router_); | 85 DCHECK(media_router_); |
| 86 observer_.reset(new TestMediaSinksObserver(media_router_, source)); | 86 observer_.reset(new TestMediaSinksObserver(media_router_, source, origin)); |
| 87 observer_->Init(); | 87 observer_->Init(); |
| 88 | 88 |
| 89 DVLOG(1) << "Receiver name: " << receiver(); | 89 DVLOG(1) << "Receiver name: " << receiver(); |
| 90 // Wait for MediaSinks compatible with |source| to be discovered. | 90 // Wait for MediaSinks compatible with |source| to be discovered. |
| 91 ASSERT_TRUE(ConditionalWait( | 91 ASSERT_TRUE(ConditionalWait( |
| 92 base::TimeDelta::FromSeconds(30), base::TimeDelta::FromSeconds(1), | 92 base::TimeDelta::FromSeconds(30), base::TimeDelta::FromSeconds(1), |
| 93 base::Bind(&MediaRouterE2EBrowserTest::IsSinkDiscovered, | 93 base::Bind(&MediaRouterE2EBrowserTest::IsSinkDiscovered, |
| 94 base::Unretained(this)))); | 94 base::Unretained(this)))); |
| 95 | 95 |
| 96 const auto& sink_map = observer_->sink_map; | 96 const auto& sink_map = observer_->sink_map; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 CreateMediaRoute(MediaSourceForPresentationUrl(kCastAppPresentationUrl), | 162 CreateMediaRoute(MediaSourceForPresentationUrl(kCastAppPresentationUrl), |
| 163 GURL(kOriginUrl), nullptr); | 163 GURL(kOriginUrl), nullptr); |
| 164 Wait(base::TimeDelta::FromSeconds(30)); | 164 Wait(base::TimeDelta::FromSeconds(30)); |
| 165 | 165 |
| 166 // Wait for 10 seconds to make sure route has been stopped. | 166 // Wait for 10 seconds to make sure route has been stopped. |
| 167 StopMediaRoute(); | 167 StopMediaRoute(); |
| 168 Wait(base::TimeDelta::FromSeconds(10)); | 168 Wait(base::TimeDelta::FromSeconds(10)); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace media_router | 171 } // namespace media_router |
| OLD | NEW |