New issue
Advanced search Search tips

Issue 898682 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

BrowserTests: Wait for content script updates as part of adding extensions

Project Member Reported by khorimoto@chromium.org, Oct 24

Issue description

We've seen flaky tests due to tests running *before* content scripts are updated. For example, see  issue 895068 . Extension tests should wait for the update to be received by the renderer before proceeding with the test.

Once this has been implemented, the stop-gap solution to deflake those tests should be removed.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7c1e9167b236e4976039efcea24b2849976f0184

commit 7c1e9167b236e4976039efcea24b2849976f0184
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Dec 21 21:39:12 2018

[Extensions] Wait for content scripts to load in test code

When loading an extension in a test environment, wait for the content
scripts to fully load. This avoids a race condition where we would load
an extension and then navigate to a tab, but potentially have scripts
that should have injected not yet loaded.

This CL incorporates the waiting period into the common loading code; a
followup will remove other tests' ad hoc waits.

Bug: 898682

Change-Id: I2c6638bac5fae332854ea89226c7fc4633648f07
Reviewed-on: https://chromium-review.googlesource.com/c/1374691
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618610}
[modify] https://crrev.com/7c1e9167b236e4976039efcea24b2849976f0184/chrome/browser/extensions/chrome_test_extension_loader.cc
[modify] https://crrev.com/7c1e9167b236e4976039efcea24b2849976f0184/chrome/browser/extensions/chrome_test_extension_loader.h
[add] https://crrev.com/7c1e9167b236e4976039efcea24b2849976f0184/chrome/browser/extensions/chrome_test_extension_loader_browsertest.cc
[modify] https://crrev.com/7c1e9167b236e4976039efcea24b2849976f0184/chrome/test/BUILD.gn
[modify] https://crrev.com/7c1e9167b236e4976039efcea24b2849976f0184/extensions/browser/user_script_loader.cc
[modify] https://crrev.com/7c1e9167b236e4976039efcea24b2849976f0184/extensions/browser/user_script_loader.h

Sign in to add a comment