Commit f2489044 authored by gogerald's avatar gogerald Committed by Commit Bot

Update cache after forcing variations

This makes the forced variation ids take effect immediately
like others after cache initialization.

Bug: 1121305
Change-Id: Id2edb803c2898b2e1f93ae3325f510b51fd0ec08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2402168Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Commit-Queue: Ganggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806339}
parent 6484f314
...@@ -108,14 +108,29 @@ VariationsIdsProvider::ForceIdsResult VariationsIdsProvider::ForceVariationIds( ...@@ -108,14 +108,29 @@ VariationsIdsProvider::ForceIdsResult VariationsIdsProvider::ForceVariationIds(
&default_variation_ids_set_)) { &default_variation_ids_set_)) {
return ForceIdsResult::INVALID_SWITCH_ENTRY; return ForceIdsResult::INVALID_SWITCH_ENTRY;
} }
if (variation_ids_cache_initialized_) {
// Update the cached variation ids header value after cache initialization,
// otherwise the change won't be in the cache.
base::AutoLock scoped_lock(lock_);
UpdateVariationIDsHeaderValue();
}
return ForceIdsResult::SUCCESS; return ForceIdsResult::SUCCESS;
} }
bool VariationsIdsProvider::ForceDisableVariationIds( bool VariationsIdsProvider::ForceDisableVariationIds(
const std::string& command_line_variation_ids) { const std::string& command_line_variation_ids) {
force_disabled_ids_set_.clear(); force_disabled_ids_set_.clear();
return ParseVariationIdsParameter(command_line_variation_ids, if (!ParseVariationIdsParameter(command_line_variation_ids,
&force_disabled_ids_set_); &force_disabled_ids_set_)) {
return false;
}
if (variation_ids_cache_initialized_) {
// Update the cached variation ids header value after cache initialization,
// otherwise the change won't be in the cache.
base::AutoLock scoped_lock(lock_);
UpdateVariationIDsHeaderValue();
}
return true;
} }
void VariationsIdsProvider::AddObserver(Observer* observer) { void VariationsIdsProvider::AddObserver(Observer* observer) {
......
...@@ -164,10 +164,6 @@ id<GREYMatcher> SearchCopiedTextButton() { ...@@ -164,10 +164,6 @@ id<GREYMatcher> SearchCopiedTextButton() {
} }
#endif #endif
// TODO(crbug.com/1121305): Test is failing due to clearing the variations on
// first run, causing tests to fail flakily on the bots.
EARL_GREY_TEST_SKIPPED(@"testXClientData fails on first simulator run.");
// TODO(crbug.com/1120723) This test is flakily because of a DCHECK in // TODO(crbug.com/1120723) This test is flakily because of a DCHECK in
// ios/web. Clearing browser history first works around the problem, but // ios/web. Clearing browser history first works around the problem, but
// shouldn't be necessary otherwise. Remove once the bug is fixed. // shouldn't be necessary otherwise. Remove once the bug is fixed.
......
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