| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 base::Bind(&MediaRouterE2EBrowserTest::IsRouteCreated, | 110 base::Bind(&MediaRouterE2EBrowserTest::IsRouteCreated, |
| 111 base::Unretained(this)))); | 111 base::Unretained(this)))); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void MediaRouterE2EBrowserTest::StopMediaRoute() { | 114 void MediaRouterE2EBrowserTest::StopMediaRoute() { |
| 115 ASSERT_FALSE(route_id_.empty()); | 115 ASSERT_FALSE(route_id_.empty()); |
| 116 media_router_->TerminateRoute(route_id_); | 116 media_router_->TerminateRoute(route_id_); |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool MediaRouterE2EBrowserTest::IsSinkDiscovered() const { | 119 bool MediaRouterE2EBrowserTest::IsSinkDiscovered() const { |
| 120 return ContainsKey(observer_->sink_map, receiver()); | 120 return base::ContainsKey(observer_->sink_map, receiver()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool MediaRouterE2EBrowserTest::IsRouteCreated() const { | 123 bool MediaRouterE2EBrowserTest::IsRouteCreated() const { |
| 124 return !route_id_.empty(); | 124 return !route_id_.empty(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void MediaRouterE2EBrowserTest::OpenMediaPage() { | 127 void MediaRouterE2EBrowserTest::OpenMediaPage() { |
| 128 base::StringPairs query_params; | 128 base::StringPairs query_params; |
| 129 query_params.push_back(std::make_pair(kVideo, kBearVP9Video)); | 129 query_params.push_back(std::make_pair(kVideo, kBearVP9Video)); |
| 130 std::string query = media::GetURLQueryString(query_params); | 130 std::string query = media::GetURLQueryString(query_params); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 161 CreateMediaRoute(MediaSourceForPresentationUrl(kCastAppPresentationUrl), | 161 CreateMediaRoute(MediaSourceForPresentationUrl(kCastAppPresentationUrl), |
| 162 GURL(kOriginUrl), nullptr); | 162 GURL(kOriginUrl), nullptr); |
| 163 Wait(base::TimeDelta::FromSeconds(30)); | 163 Wait(base::TimeDelta::FromSeconds(30)); |
| 164 | 164 |
| 165 // Wait for 10 seconds to make sure route has been stopped. | 165 // Wait for 10 seconds to make sure route has been stopped. |
| 166 StopMediaRoute(); | 166 StopMediaRoute(); |
| 167 Wait(base::TimeDelta::FromSeconds(10)); | 167 Wait(base::TimeDelta::FromSeconds(10)); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace media_router | 170 } // namespace media_router |
| OLD | NEW |