New issue
Advanced search Search tips

Issue 860509 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 16
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 778769
issue 860718

Blocking:
issue 802294



Sign in to add a comment

Only extension-related tests failing with User Activation v2

Project Member Reported by mustaq@chromium.org, Jul 5

Issue description

Since around mid June, we encountered 13 new failures in browser_tests when UAv2 is enabled.  Most (11) of them are extension related.  Wondering what might have changed with extensions in last month or so.

DeveloperPrivateApiTest.Basics
ExecuteScriptApiTest.UserGesture
ExtensionApiTest.ChromeRuntimeUninstallURL
ExtensionManagementApiTest.CreateAppShortcut
ExtensionManagementApiTest.GenerateAppForLink
ExtensionManagementApiTest.LaunchType
ExtensionManagementApiTest.ManagementPolicyAllowed
ExtensionManagementApiTest.Uninstall
ExtensionWebstorePrivateApiTest.IconUrl
ExtensionWebstorePrivateApiTest.InstallAccepted
ExtensionWebstorePrivateApiTest.MissingDownloadDir

Apparently the only change around user activation that I am aware of is this:
https://chromium-review.googlesource.com/c/chromium/src/+/1045272
which removes consumption thus relaxing the activation requirement is a way.

The failures seem related to lack of activation, so I have no clue what's the source of the problem.
 
Any chance this is related to site isolation?

Here is a console dump of DeveloperPrivateApiTest.Basics test failure:
$ ./out/Default/browser_tests --gtest_filter=DeveloperPrivateApiTest.Basics --enable-features=UserActivationV2
IMPORTANT DEBUGGING NOTE: each test is run inside its own process.
For debugging a test inside a debugger, use the
--gtest_filter=<your_test_name> flag along with either
--single_process (to run the test in one launcher/browser process) or
--single-process (to do the above, and also run Chrome in single-process mode).
Using sharding settings from environment. This is shard 0/1
Using 1 parallel jobs.
Note: Google Test filter = DeveloperPrivateApiTest.Basics
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from DeveloperPrivateApiTest, where TypeParam = 
[ RUN      ] DeveloperPrivateApiTest.Basics
[156172:156172:0705/105401.289269:WARNING:password_store_factory.cc(250)] Using basic (unencrypted) store for password storage. See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_password_storage.md for more information about password storage options.
[156217:156217:0705/105402.067942:WARNING:owning_audio_manager_accessor.cc(80)] Out of process audio service initializing.
[156172:156183:0705/105402.274072:ERROR:service_manager_context.cc(264)] Attempting to run unsupported native service: /usr/local/google/home/mustaq/Work/chromium/src/out_linux/Default/content_utility.service
[156172:156172:0705/105402.649898:WARNING:gaia_auth_fetcher.cc(902)] Could not reach Google Accounts servers: errno -11
[156172:156172:0705/105403.313161:INFO:CONSOLE(0)] "[SUCCESS] simple", source: chrome-extension://akogaincbcmhleamjngmogkaecakajep/_generated_background_page.html (0)
[156172:156172:0705/105403.336435:INFO:CONSOLE(0)] "Unchecked runtime.lastError: This action requires a user gesture.", source: chrome-extension://akogaincbcmhleamjngmogkaecakajep/_generated_background_page.html (0)
[156172:156172:0705/105403.338935:INFO:CONSOLE(0)] "Unchecked runtime.lastError: This action requires a user gesture.", source: chrome-extension://akogaincbcmhleamjngmogkaecakajep/_generated_background_page.html (0)
[156172:156172:0705/105403.343176:INFO:CONSOLE(0)] "[FAIL] aliasedFunctions: FAIL (no message)
Error
    at extensions::test:168:18
    at extensions::test:152:16
    at chrome-extension://akogaincbcmhleamjngmogkaecakajep/basics.js:48:25", source: chrome-extension://akogaincbcmhleamjngmogkaecakajep/_generated_background_page.html (0)
[156172:156172:0705/105403.347294:INFO:CONSOLE(0)] "[FAIL] aliasedFunctions: FAIL (no message)
Error
    at extensions::test:168:18
    at extensions::test:156:16
    at chrome-extension://akogaincbcmhleamjngmogkaecakajep/basics.js:57:25", source: chrome-extension://akogaincbcmhleamjngmogkaecakajep/_generated_background_page.html (0)
../../chrome/browser/extensions/api/developer_private/developer_private_apitest.cc:31: Failure
Value of: RunPlatformAppTestWithFlags( "developer/test", kFlagLoadAsComponent)
  Actual: false
Expected: true
Stack trace:
#0 0x0000042b2f00 StackTraceGetter::CurrentStackTrace()
#1 0x0000042d44b7 testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop()
#2 0x0000042d391d testing::internal::AssertHelper::operator=()
#3 0x00000349526f extensions::DeveloperPrivateApiTest_Basics_Test::RunTestOnMainThread()
#4 0x0000073a4fe3 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop()
#5 0x000001f5806d _ZN4base8internal13FunctorTraitsIM25RenderViewContextMenuBaseFvvEvE6InvokeIS4_P21RenderViewContextMenuJEEEvT_OT0_DpOT1_
#6 0x000001f57fb4 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIM25RenderViewContextMenuBaseFvvEJP21RenderViewContextMenuEEEvOT_DpOT0_
#7 0x000001f57f65 _ZN4base8internal7InvokerINS0_9BindStateIM25RenderViewContextMenuBaseFvvEJNS0_17UnretainedWrapperI21RenderViewContextMenuEEEEEFvvEE7RunImplIS5_NSt3__15tupleIJS8_EEEJLm0EEEEvOT_OT0_NSD_16integer_sequenceImJXspT1_EEEE
#8 0x000002053dfc _ZN4base8internal7InvokerINS0_9BindStateIMN13browsing_data19BrowsingDataCounterEFvvEJNS0_17UnretainedWrapperI12CacheCounterEEEEEFvvEE3RunEPNS0_13BindStateBaseE
#9 0x000001f498ad _ZNKR4base17RepeatingCallbackIFvvEE3RunEv
#10 0x00000643bc5f ChromeBrowserMainParts::PreMainMessageLoopRunImpl()
#11 0x000006439afe ChromeBrowserMainParts::PreMainMessageLoopRun()
#12 0x7fc613247ecc content::BrowserMainLoop::PreMainMessageLoopRun()
#13 0x7fc611f63ebd _ZN4base8internal13FunctorTraitsIMN7content12ChildProcessEFvvEvE6InvokeIS5_PS3_JEEEvT_OT0_DpOT1_
#14 0x7fc611f63e34 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIMN7content12ChildProcessEFvvEJPS5_EEEvOT_DpOT0_
#15 0x7fc611f63de5 _ZN4base8internal7InvokerINS0_9BindStateIMN7content12ChildProcessEFvvEJNS0_17UnretainedWrapperIS4_EEEEEFvvEE7RunImplIS6_NSt3__15tupleIJS8_EEEJLm0EEEEvOT_OT0_NSD_16integer_sequenceImJXspT1_EEEE
#16 0x7fc611f66cbc _ZN4base8internal7InvokerINS0_9BindStateIMN7content14ServiceFactoryEFvvEJNS0_17UnretainedWrapperIS4_EEEEEFvvEE3RunEPNS0_13BindStateBaseE
#17 0x7fc611e70d3d _ZNKR4base17RepeatingCallbackIFvvEE3RunEv
#18 0x7fc613fdd89d content::StartupTaskRunner::RunAllTasksNow()
#19 0x7fc6132435df content::BrowserMainLoop::CreateStartupTasks()
#20 0x7fc61324ffa7 content::BrowserMainRunnerImpl::Initialize()
#21 0x7fc61323b4c9 content::BrowserMain()
#22 0x7fc6150ffdc7 content::RunBrowserProcessMain()
#23 0x7fc615102340 content::ContentMainRunnerImpl::Run()
#24 0x7fc6150f6aa5 content::ContentServiceManagerMainDelegate::RunEmbedderProcess()
#25 0x7fc60d9f621e service_manager::Main()
#26 0x7fc6150fcd05 content::ContentMain()
#27 0x0000073a44fc content::BrowserTestBase::SetUp()
#28 0x0000062c8988 InProcessBrowserTest::SetUp()
#29 0x0000038ec27e extensions::ExtensionBrowserTest::SetUp()
#30 0x000002d94abe _ZN7testing8internal12InvokeHelperIN16sync_file_system18RemoteServiceStateENSt3__15tupleIJEEEE12InvokeMethodINS2_25MockRemoteFileSyncServiceEMS9_KFS3_vEEES3_PT_T0_RKS6_

[156172:156172:0705/105403.798875:WARNING:gaia_auth_fetcher.cc(902)] Could not reach Google Accounts servers: errno -11
[156172:156183:0705/105404.062266:WARNING:discardable_shared_memory_manager.cc(431)] Some MojoDiscardableSharedMemoryManagerImpls are still alive. They will be leaked.
[156172:156432:0705/105404.063626:WARNING:internal_linux.cc(64)] Failed to read /proc/156208/stat
[156172:156433:0705/105404.064067:WARNING:internal_linux.cc(64)] Failed to read /proc/156217/stat
[156172:156434:0705/105404.064749:WARNING:internal_linux.cc(64)] Failed to read /proc/156251/stat
[156172:156172:0705/105404.132444:WARNING:pref_notifier_impl.cc(23)] Pref observer found at shutdown.
[156172:156172:0705/105404.132511:WARNING:pref_notifier_impl.cc(23)] Pref observer found at shutdown.
[  FAILED  ] DeveloperPrivateApiTest.Basics, where TypeParam =  and GetParam() =  (5642 ms)
[----------] 1 test from DeveloperPrivateApiTest (5642 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (5642 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] DeveloperPrivateApiTest.Basics, where TypeParam =  and GetParam() = 

 1 FAILED TEST
[0705/105404.870325:ERROR:kill_posix.cc(83)] Unable to terminate process group 156172: No such process (3)
[1/1] DeveloperPrivateApiTest.Basics (7084 ms)
1 test failed:
    DeveloperPrivateApiTest.Basics (../../chrome/browser/extensions/api/developer_private/developer_private_apitest.cc:21)

Summary: Only extension-related browser_tests started failing with User Activation v2 (was: 11 new extension-related browser_tests started failing with User Activation v2)
Looks like all 13 of the 13 new failures in browser_tests are extension related.  Here are 2 more not listed above:

PermissionsApiTest.OptionalPermissionsRetainGesture
PermissionsApiTest.OptionalPermissionsUpdatesBindings


We have a failing case of interactive_ui_tests that has been failing for a few months.  Looks like this is also related to extensions, could have a common problem:

NotificationsApiTest.TestUserGesture
Cc: phanindra.mandapaka@chromium.org mustaq@chromium.org
 Issue 866576  has been merged into this issue.
Blockedon: 778769
All the tests pass with --disable-features=NativeCrxBindings, so it's the same as  Issue 866576 .
Cc: susan.boorgula@chromium.org
 Issue 871383  has been merged into this issue.
Labels: -Pri-2 Pri-1
We still need an answer for the blocker  Issue 778769 .

Here’s a very simple Chrome extension that triggers this simply by just requesting the "downloads" permission in a click event: https://github.com/mrcoles/test-chrome-extension-request-perm-beta-69-2
Upon further investigation, it seems:
- this bug is unrelated to  Issue 778769 , and
- the test failure mentioned in #c3 is different.

---

I tried with various combinations of
  --{enable,disable}-features=UserActivationv2
and
  --{enable,disable}-features=NativeCrxBindings
and found that all 13 tests mentioned in the first post and in #c2 above PASS with all 4 combinations of these two flags.  However, they all fail if the NativeCrxBindings flag is completely omitted.

I think this is a test setup problem with NativeCrxBindings flag.

rdevlin.cronin@: ptal.

---

Full test result:
https://docs.google.com/spreadsheets/d/18JxPikkwY331K0ICVd_28cIJGVhlTLbckfeqWmH8_sc/edit?usp=sharing
("+StartReq" means APIRequestHandler::StartRequest has been used in the run)

To ease investigation, we will use this bug for these 13 browser tests:

DeveloperPrivateApiTest.Basics
ExecuteScriptApiTest.UserGesture
ExtensionApiTest.ChromeRuntimeUninstallURL
ExtensionManagementApiTest.CreateAppShortcut
ExtensionManagementApiTest.GenerateAppForLink
ExtensionManagementApiTest.LaunchType
ExtensionManagementApiTest.ManagementPolicyAllowed
ExtensionManagementApiTest.Uninstall
ExtensionWebstorePrivateApiTest.IconUrl
ExtensionWebstorePrivateApiTest.InstallAccepted
ExtensionWebstorePrivateApiTest.MissingDownloadDir
PermissionsApiTest.OptionalPermissionsRetainGesture
PermissionsApiTest.OptionalPermissionsUpdatesBindings


I will track the remaining two test failures separately ( Issue 778769  covers one).
Blockedon: -778769
Components: Platform>Extensions
@10: I'm not seeing the same thing.

browser_tests --gtest_filter=DeveloperPrivateApiTest.Basics - PASS
browser_tests --gtest_filter=DeveloperPrivateApiTest.Basics --enable-features=UserActivationV2 - FAIL
browser_tests --gtest_filter=DeveloperPrivateApiTest.Basics --enable-features=UserActivationV2,NativeCrxBindings - FAIL
browser_tests --gtest_filter=DeveloperPrivateApiTest.Basics --disable-features=UserActivationV2 - PASS
browser_tests --gtest_filter=DeveloperPrivateApiTest.Basics --disable-features=UserActivationV2,NativeCrxBindings - PASS
browser_tests --gtest_filter=DeveloperPrivateApiTest.Basics --enable-features=UserActivationV2 --disable-features=NativeCrxBindings - PASS
browser_tests --gtest_filter=DeveloperPrivateApiTest.Basics --disable-features=UserActivationV2 --enable-features=NativeCrxBindings - PASS


So we're seeing the test fail if and only if UserActivationV2 and NativeCrxBindings are both enabled.  This corresponds to what we suspected, have seen on the trybots, and are seeing in the wild, and I believe is caused by  issue 778769 .  What commandline did you use to reproduce the results in the spreadsheet?  Was this on a clean build of Chromium?  In general, omitting the feature shouldn't make it behave any differently than the default (which is enabled for crx bindings on trunk).
Yours look correct.  My test script used "--enable-features=X --enable-features=Y" instead of a single comma-separated lists, yikes!  Sorry for the confusion.

The NativeBindings/* test doesn't call StartRequest(), so it still looks separate.

Which NativeBindings/* test?  I don't see one in this list?
NativeBindings/MessagingApiTest.MessagingUserGesture/0, mentioned in  Issue 778769 .
Blockedon: 778769
Correcting my post #c10 above:
- The interactive_ui_tests NotificationsApiTest.TestUserGesture is also included in this bug, so 14 tests in total.
- In all those tests, APIRequestHandler::StartRequest is called, and they all fail iff UAv2 is enabled.
Summary: Only extension-related tests failing with User Activation v2 (was: Only extension-related browser_tests started failing with User Activation v2)
After crrev.com/c/1194336 landed, 12 of the 14 failures here fixed for UAv2.

The remaining UAv2-specific failures are:
- browser_tests: NativeBindings/MessagingApiTest.MessagingUserGesture/0
- interactive_ui_tests: NotificationsApiTest.TestUserGesture

Blockedon: 860718
(We have fixes ready for two more tests in  Issue 860718 , so this blocker bug is not a concern now.)

We have three more UAv2 specific failures:
- browser_tests: NativeBindings/MessagingApiTest.MessagingUserGesture/0
- browser_tests: Native/ExtensionBindingsApiTest.UserGestureFromExtensionMessageTest/0
- interactive_ui_tests: NotificationsApiTest.TestUserGesture

Comment 21 Deleted

Looks like our fix for  Issue 860718  resolves NotificationsApiTest.TestUserGesture too, yayy.
Labels: M-72 Pri-2
Raising the priority since we are planning to ship UAv2 in M72.
Project Member

Comment 24 by bugdroid1@chromium.org, Nov 15

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

commit 4cd69a24f207f949442aa0c6b98d77e8ebe5030f
Author: Mustaq Ahmed <mustaq@google.com>
Date: Thu Nov 15 16:34:53 2018

Add a missing WebFrame pointer in MessageFromJSONString.

Fixes the following two browser tests for UAv2:
- ExtensionBindingsApiTest.UserGestureFromExtensionMessageTest
- MessagingApiTest.MessagingUserGesture

Bug:  860509 
Change-Id: I3a70c3d3fa7a6dd8351422399193e9b49c63bd0d
Reviewed-on: https://chromium-review.googlesource.com/c/1335782
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608396}
[modify] https://crrev.com/4cd69a24f207f949442aa0c6b98d77e8ebe5030f/extensions/renderer/messaging_util.cc
[modify] https://crrev.com/4cd69a24f207f949442aa0c6b98d77e8ebe5030f/extensions/renderer/messaging_util.h

Status: Fixed (was: Assigned)
NotificationsApiTest.TestUserGesture is fixed through  Issue 860718 .

Sign in to add a comment