Commit aa57fe6d authored by mark a. foltz's avatar mark a. foltz Committed by Commit Bot

[Media Router] Converts integration tests to run on Chromium waterfall.

This updates the Media Router integration tests so they run in the
Chromium waterfall with the open source Media Router component
extension and its mock (test) Media Route Provider.

Additional changes:

- Removes extension from top level BUILD.gn as it is only used for
  browser tests at the moment.
- Splits the targets for Media Router browser tests into integration tests
  (part of main browser_tests suite), e2e tests (which require the
  external component extension), perf tests, and shared support code.
- Renames the "test" extension to the "telemetry" extension used for perf
  tests to avoid confusion.
- Updates README files
- One test is not compatible with the Chromium component and need
  to be fixed.  Bugs 818767 filed for follow-up.

Bug: 698796
Change-Id: I6cc9302ffd72de95630ce33ca3617b3b73b9e722
Reviewed-on: https://chromium-review.googlesource.com/917214
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarDerek Cheng <imcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543005}
parent d44c9a6c
...@@ -92,7 +92,6 @@ group("gn_all") { ...@@ -92,7 +92,6 @@ group("gn_all") {
if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) { if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) {
deps += [ deps += [
"//chrome", "//chrome",
"//chrome/browser/resources/media_router/extension:all",
"//chrome/test:browser_tests", "//chrome/test:browser_tests",
"//chrome/test:interactive_ui_tests", "//chrome/test:interactive_ui_tests",
"//chrome/test:sync_integration_tests", "//chrome/test:sync_integration_tests",
......
...@@ -1326,7 +1326,7 @@ test("browser_tests") { ...@@ -1326,7 +1326,7 @@ test("browser_tests") {
deps += [ deps += [
"//chrome/common/extensions/api", "//chrome/common/extensions/api",
"//chrome/test/media_router:media_router_browsertests", "//chrome/test/media_router:browser_tests",
"//components/guest_view/browser:test_support", "//components/guest_view/browser:test_support",
"//components/keep_alive_registry", "//components/keep_alive_registry",
......
...@@ -2,93 +2,151 @@ ...@@ -2,93 +2,151 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
group("media_router_perf_tests") { source_set("browser_tests") {
testonly = true testonly = true
data = [ defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
"$root_out_dir/media_router/test_extension/", sources = [
"$root_out_dir/mr_extension/release/", "media_router_e2e_browsertest.cc",
"internal/", "media_router_e2e_browsertest.h",
"telemetry/", "media_router_e2e_ui_browsertest.cc",
"media_router_integration_browsertest.cc",
"media_router_integration_browsertest.h",
"media_router_integration_ui_browsertest.cc",
"media_router_one_ua_integration_browsertest.cc",
] ]
deps = [ deps = [
":test_extension_resource_files", ":test_support",
"//tools/perf:perf", "//chrome/app:generated_resources",
"//chrome/browser",
"//chrome/browser/media/router",
"//chrome/browser/ui",
"//chrome/common",
"//chrome/common/media_router:router",
"//chrome/test:test_support_ui",
"//content/public/browser",
"//content/test:test_support",
"//media:test_support",
"//net",
"//net:test_support",
"//testing/gtest",
"//ui/base",
"//url",
]
data_deps = [
":browser_test_resources",
"//chrome/browser/resources/media_router/extension:media_router",
] ]
data = [ "$root_gen_dir/chrome/browser/resources/media_router/extension/" ]
} }
group("media_router_tests") { copy("browser_test_resources") {
testonly = true
sources = [
"resources/basic_test.html",
"resources/close_route_with_error_on_send.json",
"resources/common.js",
"resources/fail_create_route.json",
"resources/fail_reconnect_session.html",
"resources/fail_reconnect_session.json",
"resources/local_media_sink.json",
"resources/local_media_sink_route_fail.json",
"resources/no_provider.json",
"resources/no_sinks.json",
"resources/no_supported_sinks.json",
"resources/presentation_receiver.html",
"resources/route_creation_timed_out.json",
]
outputs = [
"$root_out_dir/media_router/browser_test_resources/{{source_file_part}}",
]
}
# Run separately from the Chromium waterfall with the external component
# extension. See README.md
group("media_router_e2e_tests") {
testonly = true testonly = true
data_deps = [ data_deps = [
":browser_test_resources",
":e2e_test_resources",
"//chrome/test:browser_tests", "//chrome/test:browser_tests",
] ]
data = [ data = [
"$root_out_dir/mr_extension/", "$root_out_dir/mr_extension/",
"internal/",
"../../../media/test/data/player.html",
"../../../media/test/data/bear-vp9.webm",
] ]
} }
# Browser test resource files. copy("e2e_test_resources") {
media_router_integration_test_resources = [ testonly = true
"resources/basic_test.html", sources = [
"resources/close_route_with_error_on_send.json", "../../../media/test/data/bear-vp9.webm",
"resources/common.js", "../../../media/test/data/player.html",
"resources/fail_create_route.json", ]
"resources/fail_reconnect_session.html",
"resources/fail_reconnect_session.json",
"resources/local_media_sink.json",
"resources/local_media_sink_route_fail.json",
"resources/no_provider.json",
"resources/no_sinks.json",
"resources/no_supported_sinks.json",
"resources/presentation_receiver.html",
"resources/route_creation_timed_out.json",
]
media_router_test_extension_resources = [
"telemetry/extension/manifest.json",
"telemetry/extension/script.js",
]
copy("test_extension_resource_files") {
sources = media_router_test_extension_resources
outputs = [ outputs = [
"$root_out_dir/media_router/test_extension/{{source_file_part}}", "$root_out_dir/media_router/browser_test_resources/{{source_file_part}}",
] ]
} }
copy("browser_tests_resource_files") { # Run separately. TODO: Documentation on how to run
sources = media_router_integration_test_resources group("swarming_tests") {
outputs = [ testonly = true
"$root_out_dir/media_router/browser_test_resources/{{source_file_part}}", data_deps = [
":browser_test_resources",
"//chrome/test:browser_tests",
]
data = [
"internal/",
"$root_out_dir/mr_extension/",
] ]
} }
source_set("media_router_browsertests") { source_set("test_support") {
testonly = true testonly = true
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
sources = [ sources = [
"media_router_base_browsertest.cc", "media_router_base_browsertest.cc",
"media_router_base_browsertest.h", "media_router_base_browsertest.h",
"media_router_e2e_browsertest.cc",
"media_router_e2e_browsertest.h",
"media_router_e2e_ui_browsertest.cc",
"media_router_integration_browsertest.cc",
"media_router_integration_browsertest.h",
"media_router_integration_ui_browsertest.cc",
"media_router_one_ua_integration_browsertest.cc",
"test_media_sinks_observer.cc", "test_media_sinks_observer.cc",
"test_media_sinks_observer.h", "test_media_sinks_observer.h",
] ]
public_deps = [
"//base",
"//chrome/browser/extensions",
"//extensions/browser",
]
deps = [ deps = [
":browser_tests_resource_files", "//chrome/browser/media/router",
"//chrome/browser/media/router:test_support", "//chrome/browser/media/router:test_support",
"//chrome/common:constants",
"//chrome/test:test_support", "//chrome/test:test_support",
"//chrome/test:test_support_ui", "//chrome/test:test_support_ui",
"//extensions/browser", "//content/public/common",
"//media:test_support", "//content/test:test_support",
"//skia", "//extensions/common",
"//testing/gtest", "//testing/gtest",
] ]
} }
group("media_router_perf_tests") {
testonly = true
data = [
"$root_out_dir/media_router/telemetry_extension/",
"$root_out_dir/mr_extension/release/",
"internal/",
"telemetry/",
]
deps = [
"//tools/perf:perf",
]
data_deps = [
":telemetry_extension_resources",
]
}
copy("telemetry_extension_resources") {
sources = [
"telemetry/extension/manifest.json",
"telemetry/extension/script.js",
]
outputs = [
"$root_out_dir/media_router/telemetry_extension/{{source_file_part}}",
]
}
...@@ -6,22 +6,39 @@ ...@@ -6,22 +6,39 @@
# Media Router Integration and E2E Browser Tests # Media Router Integration and E2E Browser Tests
This directory contains the integration and end-to-end browser tests for Media This directory contains the integration and end-to-end browser tests for Media
Router. Note that running these tests requires a dev build of the Media Router Router. The Media Router uses various Media Route Providers to connect to
component extension, which isn't open source. The project for upstreaming the different types of displays.
component extension is [tracked by this bug](http://crbug.com/698796).
## Test classes ## Media Route Providers
The tests are run with one of two component extensions:
* The open source Media Router component extension in
chrome/browser/resources/media_router/extension includes a mock Media Route
Provider, `mr.TestProvider`.
* The closed source Media Router external component extension includes the Cast
Media Route Provider.
## Tests
* `MediaRouterIntegrationBrowserTest`: Tests that Media Router behaves as * `MediaRouterIntegrationBrowserTest`: Tests that Media Router behaves as
specified by the Presentation API, and that its dialog is shown as expected. specified by the Presentation API, and that its dialog is shown as expected
Uses `mr.TestProvider` (provided the component extension) as the Media Route using the test provider `mr.TestProvider`. Test cases that specifically test the
Provider. Test cases that specifically test the functionalities of the Media functionalities of the Media Router dialog are in
Router dialog are in `media_router_integration_ui_browsertest.cc`. `media_router_integration_ui_browsertest.cc`.
* `MediaRouterIntegrationIncognitoBrowserTest`: Same as * `MediaRouterIntegrationIncognitoBrowserTest`: Same as
`MediaRouterIntegrationBrowserTest`, except for that the tests are run using an `MediaRouterIntegrationBrowserTest`, except for that the tests are run using an
incognito profile. incognito profile.
* `MediaRouterE2EBrowserTest`: Tests the casting functionality of Media Router * `MediaRouterE2EBrowserTest`: Tests Chromecast-specific functionality of Media
using the Cast Media Route Provider (provided by the component extension) and an Router using the Cast Media Route Provider. Requires installing the Media
actual Chromecast device. Router external component extension and an actual Chromecast device.
* `MediaRouterIntegrationOneUABrowserTest`: Tests that the Presentation API can
be used to start presentations using offscreen tabs, and that basic Presentation
API usage with offscreen tabs is working.
* `MediaRouterIntegrationOneUANoReceiverBrowserTest`: Tests Presentation API
behavior when there is no compatible presentation receiver for the requested
URL.
...@@ -113,12 +113,12 @@ void MediaRouterBaseBrowserTest::ParseCommandLine() { ...@@ -113,12 +113,12 @@ void MediaRouterBaseBrowserTest::ParseCommandLine() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
extension_unpacked_ = command_line->GetSwitchValuePath(kExtensionUnpacked); extension_unpacked_ = command_line->GetSwitchValuePath(kExtensionUnpacked);
// Check if there is mr_extension folder under PRODUCT_DIR folder. // No extension provided. Use the default component extension in Chromium.
if (extension_unpacked_.empty()) { if (extension_unpacked_.empty()) {
base::FilePath base_dir; base::FilePath base_dir;
ASSERT_TRUE(PathService::Get(base::DIR_MODULE, &base_dir)); ASSERT_TRUE(PathService::Get(base::DIR_MODULE, &base_dir));
base::FilePath extension_path = base::FilePath extension_path = base_dir.Append(FILE_PATH_LITERAL(
base_dir.Append(FILE_PATH_LITERAL("mr_extension/")); "gen/chrome/browser/resources/media_router/extension"));
if (PathExists(extension_path)) { if (PathExists(extension_path)) {
extension_unpacked_ = extension_path; extension_unpacked_ = extension_path;
} }
......
...@@ -699,13 +699,14 @@ void MediaRouterIntegrationBrowserTest::RunReconnectSessionSameTabTest() { ...@@ -699,13 +699,14 @@ void MediaRouterIntegrationBrowserTest::RunReconnectSessionSameTabTest() {
ASSERT_EQ(session_id, reconnected_session_id); ASSERT_EQ(session_id, reconnected_session_id);
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, MANUAL_Basic) { IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, Basic) {
RunBasicTest(); RunBasicTest();
} }
// Tests that creating a route with a local file opens the file in a new tab. // Tests that creating a route with a local file opens the file in a new tab.
// TODO(crbug.com/818767): Fails when run with Chromium component.
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_OpenLocalMediaFileInCurrentTab) { DISABLED_OpenLocalMediaFileInCurrentTab) {
// Start at a new tab, the file should open in the same tab. // Start at a new tab, the file should open in the same tab.
ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL));
// Make sure there is 1 tab. // Make sure there is 1 tab.
...@@ -725,7 +726,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, ...@@ -725,7 +726,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
// Tests that creating a route with a local file opens the file in a new tab. // Tests that creating a route with a local file opens the file in a new tab.
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_OpenLocalMediaFileInNewTab) { OpenLocalMediaFileInNewTab) {
// Start at a tab with content in it, the file will open in a new tab. // Start at a tab with content in it, the file will open in a new tab.
ui_test_utils::NavigateToURL(browser(), GURL("http://google.com")); ui_test_utils::NavigateToURL(browser(), GURL("http://google.com"));
// Make sure there is 1 tab. // Make sure there is 1 tab.
...@@ -745,7 +746,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, ...@@ -745,7 +746,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
// Tests that failing to create a route with a local file shows an issue. // Tests that failing to create a route with a local file shows an issue.
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_OpenLocalMediaFileFailsAndShowsIssue) { OpenLocalMediaFileFailsAndShowsIssue) {
OpenDialogAndCastFileFails(); OpenDialogAndCastFileFails();
// Expect that the issue is showing. // Expect that the issue is showing.
ASSERT_TRUE(IsUIShowingIssue()); ASSERT_TRUE(IsUIShowingIssue());
...@@ -753,7 +754,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, ...@@ -753,7 +754,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
// Tests that creating a route with a local file opens in fullscreen. // Tests that creating a route with a local file opens in fullscreen.
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_OpenLocalMediaFileFullscreen) { OpenLocalMediaFileFullscreen) {
// Start at a new tab, the file should open in the same tab. // Start at a new tab, the file should open in the same tab.
ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL));
// Make sure there is 1 tab. // Make sure there is 1 tab.
...@@ -776,7 +777,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, ...@@ -776,7 +777,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
// Tests that failed route creation of local file does not enter fullscreen. // Tests that failed route creation of local file does not enter fullscreen.
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_OpenLocalMediaFileCastFailNoFullscreen) { OpenLocalMediaFileCastFailNoFullscreen) {
// Start at a new tab, the file should open in the same tab. // Start at a new tab, the file should open in the same tab.
ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL));
// Make sure there is 1 tab. // Make sure there is 1 tab.
...@@ -796,12 +797,11 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, ...@@ -796,12 +797,11 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
web_contents->GetDelegate()->IsFullscreenForTabOrPending(web_contents)); web_contents->GetDelegate()->IsFullscreenForTabOrPending(web_contents));
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, SendAndOnMessage) {
MANUAL_SendAndOnMessage) {
RunSendMessageTest("foo"); RunSendMessageTest("foo");
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, MANUAL_CloseOnError) { IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, CloseOnError) {
SetTestData(FILE_PATH_LITERAL("close_route_with_error_on_send.json")); SetTestData(FILE_PATH_LITERAL("close_route_with_error_on_send.json"));
WebContents* web_contents = StartSessionWithTestPageAndChooseSink(); WebContents* web_contents = StartSessionWithTestPageAndChooseSink();
CheckSessionValidity(web_contents); CheckSessionValidity(web_contents);
...@@ -809,33 +809,29 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, MANUAL_CloseOnError) { ...@@ -809,33 +809,29 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, MANUAL_CloseOnError) {
kSendMessageAndExpectConnectionCloseOnErrorScript); kSendMessageAndExpectConnectionCloseOnErrorScript);
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, Fail_SendMessage) {
MANUAL_Fail_SendMessage) {
RunFailToSendMessageTest(); RunFailToSendMessageTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, Fail_NoProvider) {
MANUAL_Fail_NoProvider) {
SetTestData(FILE_PATH_LITERAL("no_provider.json")); SetTestData(FILE_PATH_LITERAL("no_provider.json"));
WebContents* web_contents = StartSessionWithTestPageAndChooseSink(); WebContents* web_contents = StartSessionWithTestPageAndChooseSink();
CheckStartFailed(web_contents, "UnknownError", CheckStartFailed(web_contents, "UnknownError",
"No provider supports createRoute with source"); "No provider supports createRoute with source");
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, Fail_CreateRoute) {
MANUAL_Fail_CreateRoute) {
SetTestData(FILE_PATH_LITERAL("fail_create_route.json")); SetTestData(FILE_PATH_LITERAL("fail_create_route.json"));
WebContents* web_contents = StartSessionWithTestPageAndChooseSink(); WebContents* web_contents = StartSessionWithTestPageAndChooseSink();
CheckStartFailed(web_contents, "UnknownError", "Unknown sink"); CheckStartFailed(web_contents, "UnknownError", "Unknown sink");
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, ReconnectSession) {
MANUAL_ReconnectSession) {
RunReconnectSessionTest(); RunReconnectSessionTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_Fail_ReconnectSession) { Fail_ReconnectSession) {
WebContents* web_contents = StartSessionWithTestPageAndChooseSink(); WebContents* web_contents = StartSessionWithTestPageAndChooseSink();
CheckSessionValidity(web_contents); CheckSessionValidity(web_contents);
std::string session_id(GetStartedConnectionId(web_contents)); std::string session_id(GetStartedConnectionId(web_contents));
...@@ -850,21 +846,20 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, ...@@ -850,21 +846,20 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
session_id.c_str())); session_id.c_str()));
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, Fail_StartCancelled) {
MANUAL_Fail_StartCancelled) {
WebContents* web_contents = StartSessionWithTestPageAndSink(); WebContents* web_contents = StartSessionWithTestPageAndSink();
GetControllerForShownDialog(web_contents)->HideMediaRouterDialog(); GetControllerForShownDialog(web_contents)->HideMediaRouterDialog();
CheckStartFailed(web_contents, "NotAllowedError", "Dialog closed."); CheckStartFailed(web_contents, "NotAllowedError", "Dialog closed.");
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_Fail_StartCancelledNoSinks) { Fail_StartCancelledNoSinks) {
SetTestData(FILE_PATH_LITERAL("no_sinks.json")); SetTestData(FILE_PATH_LITERAL("no_sinks.json"));
StartSessionAndAssertNotFoundError(); StartSessionAndAssertNotFoundError();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_Fail_StartCancelledNoSupportedSinks) { Fail_StartCancelledNoSupportedSinks) {
SetTestData(FILE_PATH_LITERAL("no_supported_sinks.json")); SetTestData(FILE_PATH_LITERAL("no_supported_sinks.json"));
StartSessionAndAssertNotFoundError(); StartSessionAndAssertNotFoundError();
} }
...@@ -887,13 +882,12 @@ Browser* MediaRouterIntegrationIncognitoBrowserTest::browser() { ...@@ -887,13 +882,12 @@ Browser* MediaRouterIntegrationIncognitoBrowserTest::browser() {
return incognito_browser_; return incognito_browser_;
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationIncognitoBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationIncognitoBrowserTest, Basic) {
MANUAL_Basic) {
RunBasicTest(); RunBasicTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationIncognitoBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationIncognitoBrowserTest,
MANUAL_ReconnectSession) { ReconnectSession) {
RunReconnectSessionTest(); RunReconnectSessionTest();
} }
......
...@@ -18,7 +18,7 @@ namespace { ...@@ -18,7 +18,7 @@ namespace {
const char kTestSinkName[] = "test-sink-1"; const char kTestSinkName[] = "test-sink-1";
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, MANUAL_Dialog_Basic) { IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, Dialog_Basic) {
OpenTestPage(FILE_PATH_LITERAL("basic_test.html")); OpenTestPage(FILE_PATH_LITERAL("basic_test.html"));
content::WebContents* web_contents = content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents(); browser()->tab_strip_model()->GetActiveWebContents();
...@@ -134,7 +134,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, MANUAL_Dialog_Basic) { ...@@ -134,7 +134,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, MANUAL_Dialog_Basic) {
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
MANUAL_Dialog_RouteCreationTimedOut) { Dialog_RouteCreationTimedOut) {
SetTestData(FILE_PATH_LITERAL("route_creation_timed_out.json")); SetTestData(FILE_PATH_LITERAL("route_creation_timed_out.json"));
OpenTestPage(FILE_PATH_LITERAL("basic_test.html")); OpenTestPage(FILE_PATH_LITERAL("basic_test.html"));
content::WebContents* web_contents = content::WebContents* web_contents =
......
...@@ -42,34 +42,34 @@ class MediaRouterIntegrationOneUABrowserTest ...@@ -42,34 +42,34 @@ class MediaRouterIntegrationOneUABrowserTest
} }
}; };
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest, MANUAL_Basic) { IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest, Basic) {
RunBasicTest(); RunBasicTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest,
MANUAL_SendAndOnMessage) { SendAndOnMessage) {
RunSendMessageTest("foo"); RunSendMessageTest("foo");
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest,
MANUAL_ReceiverCloseConnection) { ReceiverCloseConnection) {
WebContents* web_contents = StartSessionWithTestPageAndChooseSink(); WebContents* web_contents = StartSessionWithTestPageAndChooseSink();
CheckSessionValidity(web_contents); CheckSessionValidity(web_contents);
ExecuteJavaScriptAPI(web_contents, kInitiateCloseFromReceiverPageScript); ExecuteJavaScriptAPI(web_contents, kInitiateCloseFromReceiverPageScript);
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest,
MANUAL_Fail_SendMessage) { Fail_SendMessage) {
RunFailToSendMessageTest(); RunFailToSendMessageTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest,
MANUAL_ReconnectSession) { ReconnectSession) {
RunReconnectSessionTest(); RunReconnectSessionTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUABrowserTest,
MANUAL_ReconnectSessionSameTab) { ReconnectSessionSameTab) {
RunReconnectSessionSameTabTest(); RunReconnectSessionSameTabTest();
} }
...@@ -83,22 +83,22 @@ class MediaRouterIntegrationOneUANoReceiverBrowserTest ...@@ -83,22 +83,22 @@ class MediaRouterIntegrationOneUANoReceiverBrowserTest
}; };
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUANoReceiverBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUANoReceiverBrowserTest,
MANUAL_Basic) { Basic) {
RunBasicTest(); RunBasicTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUANoReceiverBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUANoReceiverBrowserTest,
MANUAL_Fail_SendMessage) { Fail_SendMessage) {
RunFailToSendMessageTest(); RunFailToSendMessageTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUANoReceiverBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUANoReceiverBrowserTest,
MANUAL_ReconnectSession) { ReconnectSession) {
RunReconnectSessionTest(); RunReconnectSessionTest();
} }
IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUANoReceiverBrowserTest, IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationOneUANoReceiverBrowserTest,
MANUAL_ReconnectSessionSameTab) { ReconnectSessionSameTab) {
RunReconnectSessionSameTabTest(); RunReconnectSessionSameTabTest();
} }
......
...@@ -3,13 +3,25 @@ ...@@ -3,13 +3,25 @@
found in the LICENSE file. found in the LICENSE file.
--> -->
# How to run benchmarks for media router # How to run benchmarks for Media Router
1. Run the following command to find all the avaiable browsers: 1. Run the following command to find all the available browsers:
```shell
./chrome/test/media_router/telemetry/run_benchmark --browser list ./chrome/test/media_router/telemetry/run_benchmark --browser list
```
Let `<browser>` be one of the results.
2. Run the following command to get benchmarks for media router dialog latency: 2. Run the following command to get benchmarks for media router dialog latency:
./chrome/test/media_router/telemetry/run_benchmark --browser=<one of the values returned in step 1> media_router.dialog.latency.tracing --reset-results
./chrome/test/media_router/telemetry/run_benchmark --browser=<one of the values returned in step 1> media_router.dialog.latency.histogram ```shell
./chrome/test/media_router/telemetry/run_benchmark --browser=<browser> \
media_router.dialog.latency.tracing --reset-results
./chrome/test/media_router/telemetry/run_benchmark --browser=<browser> \
media_router.dialog.latency.histogram
```
The results will be in
`<chromium src folder>/chrome/test/media_router/telemetry/results.html`
The results will be in <chromium src folder>/chrome/test/media_router/telemetry/results.html
...@@ -31,7 +31,7 @@ class _BaseCastBenchmark(perf_benchmark.PerfBenchmark): ...@@ -31,7 +31,7 @@ class _BaseCastBenchmark(perf_benchmark.PerfBenchmark):
os.path.join(path_util.GetChromiumSrcDir(), 'out', os.path.join(path_util.GetChromiumSrcDir(), 'out',
'Release', 'mr_extension', 'release'), 'Release', 'mr_extension', 'release'),
os.path.join(path_util.GetChromiumSrcDir(), 'out', os.path.join(path_util.GetChromiumSrcDir(), 'out',
'Release', 'media_router', 'test_extension')]), 'Release', 'media_router', 'telemetry_extension')]),
'--whitelisted-extension-id=enhhojjnijigcajfphajepfemndkmdlo', '--whitelisted-extension-id=enhhojjnijigcajfphajepfemndkmdlo',
'--media-router=1', '--media-router=1',
'--enable-stats-collection-bindings' '--enable-stats-collection-bindings'
......
This is the test extension which is used to get CPU/memory usage for media router performance test. This is the test extension which is used to get CPU/memory usage for Media
Router performance test.
chrome/test/media_router/telemetry/benchmarks/pagesets/cpu_memory_script.js shows how to interact with this test extension to get CPU/memory usage. `chrome/test/media_router/telemetry/benchmarks/pagesets/cpu_memory_script.js`
shows how to interact with this test extension to get CPU/memory usage.
...@@ -276,3 +276,11 @@ ...@@ -276,3 +276,11 @@
# Flaky segfaults: https://crbug.com/818147 # Flaky segfaults: https://crbug.com/818147
-ExtensionApiTest.BookmarkManager -ExtensionApiTest.BookmarkManager
# Depends on chrome/browser/media/webrtc; CHECKs in ash::Shell::Get()
# https://crbug.com/723880
-MediaRouterIntegrationBrowserTest.*
-MediaRouterIntegrationOneUABrowserTest.*
-MediaRouterIntegrationOneUANoReceiverBrowserTest.*
...@@ -784,7 +784,7 @@ ...@@ -784,7 +784,7 @@
], ],
}, },
"media_router_tests": { "media_router_tests": {
"label": "//chrome/test/media_router:media_router_tests", "label": "//chrome/test/media_router:media_router_e2e_tests",
"type": "script", "type": "script",
"script": "//chrome/test/media_router/internal/media_router_tests.py", "script": "//chrome/test/media_router/internal/media_router_tests.py",
"args": [ "args": [
......
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