Commit 64233e4a authored by Derek Cheng's avatar Derek Cheng Committed by Commit Bot

[Media Router] Fix one-ua no-receiver integration tests.

- Don't depend on external resources for presentation URLs. Changed
the url in the test from https://google.com to a local page.
- One-UA no-receiver tests need to fire up a EmbeddedTestServer in order
for presentation URLs to resolve to https: scheme.

Bug: 840059
Change-Id: If5c4bc7e00b75a37d5df94e05b1ebad49e7cdd67
Reviewed-on: https://chromium-review.googlesource.com/1050885Reviewed-by: default avatarAdam Parker <amp@chromium.org>
Commit-Queue: Derek Cheng <imcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557228}
parent 959669a6
...@@ -36,7 +36,9 @@ source_set("browser_tests") { ...@@ -36,7 +36,9 @@ source_set("browser_tests") {
":browser_test_resources", ":browser_test_resources",
"//chrome/browser/resources/media_router/extension:media_router", "//chrome/browser/resources/media_router/extension:media_router",
] ]
data = [ "$root_gen_dir/chrome/browser/resources/media_router/extension/" ] data = [
"$root_gen_dir/chrome/browser/resources/media_router/extension/",
]
} }
copy("browser_test_resources") { copy("browser_test_resources") {
...@@ -50,6 +52,7 @@ copy("browser_test_resources") { ...@@ -50,6 +52,7 @@ copy("browser_test_resources") {
"resources/fail_reconnect_session.json", "resources/fail_reconnect_session.json",
"resources/local_media_sink.json", "resources/local_media_sink.json",
"resources/local_media_sink_route_fail.json", "resources/local_media_sink_route_fail.json",
"resources/no_presentation_receiver.html",
"resources/no_provider.json", "resources/no_provider.json",
"resources/no_sinks.json", "resources/no_sinks.json",
"resources/no_supported_sinks.json", "resources/no_supported_sinks.json",
......
...@@ -37,8 +37,7 @@ class MediaRouterIntegrationOneUABrowserTest ...@@ -37,8 +37,7 @@ class MediaRouterIntegrationOneUABrowserTest
} }
GURL GetTestPageUrl(const base::FilePath& full_path) override { GURL GetTestPageUrl(const base::FilePath& full_path) override {
GURL url = embedded_test_server()->GetURL("/basic_test.html"); return embedded_test_server()->GetURL("/basic_test.html?__oneUA__=true");
return GURL(url.spec() + "?__oneUA__=true");
} }
}; };
...@@ -80,11 +79,11 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest, ...@@ -80,11 +79,11 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest,
} }
class MediaRouterIntegrationOneUANoReceiverBrowserTest class MediaRouterIntegrationOneUANoReceiverBrowserTest
: public MediaRouterIntegrationBrowserTest { : public MediaRouterIntegrationOneUABrowserTest {
public: public:
GURL GetTestPageUrl(const base::FilePath& full_path) override { GURL GetTestPageUrl(const base::FilePath& full_path) override {
GURL url = MediaRouterIntegrationBrowserTest::GetTestPageUrl(full_path); return embedded_test_server()->GetURL(
return GURL(url.spec() + "?__oneUANoReceiver__=true"); "/basic_test.html?__oneUANoReceiver__=true");
} }
}; };
......
...@@ -19,7 +19,7 @@ if (params.get('__is_android__') == 'true') { ...@@ -19,7 +19,7 @@ if (params.get('__is_android__') == 'true') {
} else if (params.get('__oneUA__') == 'true') { } else if (params.get('__oneUA__') == 'true') {
presentationUrl = "presentation_receiver.html"; presentationUrl = "presentation_receiver.html";
} else if (params.get('__oneUANoReceiver__') == 'true') { } else if (params.get('__oneUANoReceiver__') == 'true') {
presentationUrl = "https://www.google.com"; presentationUrl = "no_presentation_receiver.html";
} else { } else {
presentationUrl = "test://test"; presentationUrl = "test://test";
} }
......
<!DOCTYPE HTML>
<html>
<head>
<title>Media Router Integration Test - Receiver Page (No navigator.presentation.receiver)</title>
<!-- This page is intentionally left empty to test receiver pages that do not use the Presentation Receiver API. -->
</head>
<body>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment