Commit 74e41411 authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Enable JavaScript console logs in XR tests

Enables JavaScript console logs being copied to the system log in all
XR instrumentation and browser tests. This used to be the default, but
was recently changed to be disabled by default for privacy reasons.

Bug: 956784
Change-Id: I2f417bea9149bddf168e342d4674524624628c19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1585072
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Bill Orr <billorr@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarBill Orr <billorr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654566}
parent 449ac819
......@@ -47,7 +47,8 @@ import java.util.concurrent.atomic.AtomicReference;
* End-to-end tests for Daydream controller input while in the VR browser.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@CommandLineFlags.
Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=LogJsConsoleMessages"})
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM_OR_STANDALONE)
public class VrBrowserControllerInputTest {
// We explicitly instantiate a rule here instead of using parameterization since this class
......
......@@ -43,7 +43,8 @@ import java.util.concurrent.TimeoutException;
* End-to-End test for capturing and comparing screen images for VR Browsering Dialogs
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@CommandLineFlags.
Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=LogJsConsoleMessages"})
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM_OR_STANDALONE)
public class VrBrowserDialogTest {
// We need to make sure the port is constant, otherwise the URL changes between test runs, which
......
......@@ -45,7 +45,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
* End-to-end tests for native UI presentation in VR Browser mode.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-webvr"})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=LogJsConsoleMessages", "enable-webvr"})
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM_OR_STANDALONE)
public class VrBrowserNativeUiTest {
// We need to make sure the port is constant, otherwise the URL changes between test runs, which
......
......@@ -60,7 +60,8 @@ import java.util.concurrent.TimeoutException;
* "VR Shell".
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-webvr"})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=LogJsConsoleMessages", "enable-webvr"})
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM_OR_STANDALONE)
public class VrBrowserNavigationTest {
// We explicitly instantiate a rule here instead of using parameterization since this class
......
......@@ -60,7 +60,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
* into the VR browser.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@CommandLineFlags.
Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=LogJsConsoleMessages"})
public class VrBrowserTransitionTest {
// We explicitly instantiate a rule here instead of using parameterization since this class
// only ever runs in ChromeTabbedActivity.
......
......@@ -44,7 +44,8 @@ import java.util.concurrent.TimeoutException;
* End-to-end tests for interacting with HTML input elements on a webpage.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@CommandLineFlags.
Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=LogJsConsoleMessages"})
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM_OR_STANDALONE)
public class VrBrowserWebInputEditingTest {
// We explicitly instantiate a rule here instead of using parameterization since this class
......
......@@ -38,7 +38,8 @@ import java.util.concurrent.Callable;
*/
@RunWith(ParameterizedRunner.class)
@UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@CommandLineFlags.
Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=LogJsConsoleMessages"})
@MinAndroidSdkLevel(Build.VERSION_CODES.N) // Daydream is only supported on N+.
public class VrDaydreamReadyModuleInstallTest {
@ClassParameter
......
......@@ -35,7 +35,8 @@ import java.util.concurrent.TimeoutException;
* Tests for the infobar that prompts the user to enter feedback on their VR browsing experience.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-webvr"})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=LogJsConsoleMessages", "enable-webvr"})
@Restriction({RESTRICTION_TYPE_DEVICE_DAYDREAM, RESTRICTION_TYPE_SVR})
public class VrFeedbackInfoBarTest {
// We explicitly instantiate a rule here instead of using parameterization since this class
......
......@@ -51,7 +51,8 @@ import java.util.concurrent.Callable;
*/
@RunWith(ParameterizedRunner.class)
@UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
@CommandLineFlags.
Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=LogJsConsoleMessages"})
@MinAndroidSdkLevel(Build.VERSION_CODES.KITKAT) // WebVR is only supported on K+
@Restriction(RESTRICTION_TYPE_SVR)
public class VrInstallUpdateInfoBarTest {
......
......@@ -37,8 +37,8 @@ import java.util.concurrent.Callable;
*/
@RunWith(ParameterizedRunner.class)
@UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
@CommandLineFlags.
Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=WebXR,WebXRHitTest"})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=WebXR,WebXRHitTest,LogJsConsoleMessages"})
@MinAndroidSdkLevel(Build.VERSION_CODES.N) // WebXR for AR is only supported on N+
public class WebXrArSessionTest {
@ClassParameter
......
......@@ -45,7 +45,8 @@ import java.util.concurrent.Callable;
*/
@RunWith(ParameterizedRunner.class)
@UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-webvr"})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=LogJsConsoleMessages", "enable-webvr"})
@MinAndroidSdkLevel(Build.VERSION_CODES.KITKAT) // WebVR is only supported on K+
public class WebXrVrDeviceTest {
@ClassParameter
......
......@@ -63,7 +63,8 @@ import java.util.concurrent.TimeUnit;
*/
@RunWith(ParameterizedRunner.class)
@UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-webvr"})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=LogJsConsoleMessages", "enable-webvr"})
@MinAndroidSdkLevel(Build.VERSION_CODES.KITKAT) // WebVR and WebXR are only supported on K+
public class WebXrVrInputTest {
@ClassParameter
......
......@@ -41,7 +41,8 @@ import java.util.concurrent.Callable;
*/
@RunWith(ParameterizedRunner.class)
@UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-webvr"})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=LogJsConsoleMessages", "enable-webvr"})
@MinAndroidSdkLevel(Build.VERSION_CODES.KITKAT) // WebVR is only supported on K+
public class WebXrVrTabTest {
@ClassParameter
......
......@@ -67,7 +67,8 @@ import java.util.concurrent.TimeoutException;
*/
@RunWith(ParameterizedRunner.class)
@UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-webvr"})
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=LogJsConsoleMessages", "enable-webvr"})
@MinAndroidSdkLevel(Build.VERSION_CODES.KITKAT) // WebVR and WebXR are only supported on K+
@TargetApi(Build.VERSION_CODES.KITKAT) // Necessary to allow taking screenshots with UiAutomation
public class WebXrVrTransitionTest {
......
......@@ -23,6 +23,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test_utils.h"
#include "url/gurl.h"
......@@ -47,7 +48,9 @@ const std::vector<std::pair<std::string, std::string>>
XrBrowserTestBase::kRequiredTestSwitchesWithValues{
std::pair<std::string, std::string>("test-launcher-jobs", "1")};
XrBrowserTestBase::XrBrowserTestBase() : env_(base::Environment::Create()) {}
XrBrowserTestBase::XrBrowserTestBase() : env_(base::Environment::Create()) {
enable_features_.push_back(features::kLogJsConsoleMessages);
}
XrBrowserTestBase::~XrBrowserTestBase() = default;
......
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