Skip to content

Commit

Permalink
WebView: Disable field trial test config
Browse files Browse the repository at this point in the history
Chrome turns on the studies specified in fieldtrial_testing_config.json
for testing purposes. It doesn't respect the difference between android
and android_webview platforms, so WebView gets all of Android Chrome's
studies enabled, including UseSurfaceLayerForVideo which breaks WebView.
As a workaround, disable the test config.

BUG=853832

Change-Id: Ib8453ac163c7ce71419d25fc5433d3b31b89e894
Reviewed-on: https://chromium-review.googlesource.com/1105608
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Ilya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568569}
  • Loading branch information
Paul Miller authored and Commit Bot committed Jun 19, 2018
1 parent 8e203a7 commit 03ffa71
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions android_webview/browser/aw_field_trial_creator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "components/variations/seed_response.h"
#include "components/variations/service/safe_seed_manager.h"
#include "components/variations/service/variations_service.h"
#include "components/variations/variations_switches.h"

namespace android_webview {
namespace {
Expand Down Expand Up @@ -63,6 +64,14 @@ AwFieldTrialCreator::AwFieldTrialCreator()
AwFieldTrialCreator::~AwFieldTrialCreator() {}

void AwFieldTrialCreator::SetUpFieldTrials() {
// Workaround for https://crbug.com/853832: In testing, Chrome's experiments
// are applied to WebView. Some of these break WebView. So disable the testing
// config. TODO(paulmiller): Remove after 853832 is fixed.
auto* cmd = base::CommandLine::ForCurrentProcess();
if (!cmd->HasSwitch(variations::switches::kDisableFieldTrialTestingConfig)) {
cmd->AppendSwitch(variations::switches::kDisableFieldTrialTestingConfig);
}

DoSetUpFieldTrials();

// If DoSetUpFieldTrials failed, it might have skipped creating
Expand Down

0 comments on commit 03ffa71

Please sign in to comment.