Origin trials is causing WindowProxy to be initialized too early |
||||||||||
Issue descriptionhttps://build.chromium.org/p/chromium.chromedriver/builders/Linux/builds/30947 ====================================================================== ERROR: testNetworkConnectionTypeIsAppliedToAllTabs (__main__.MobileEmulationCapabilityTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/run_py_tests.py", line 2295, in testNetworkConnectionTypeIsAppliedToAllTabs driver.FindElement('id', 'link').Click() File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 346, in FindElement Command.FIND_ELEMENT, {'using': strategy, 'value': target}) File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 291, in ExecuteCommand response = self._ExecuteCommand(command, params) File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 284, in _ExecuteCommand raise _ExceptionForLegacyResponse(response) NoSuchElement: no such element: Unable to locate element: {"method":"id","selector":"link"} (Session info: chrome=63.0.3214.0) (Driver info: chromedriver=2.32.500270 (4b0eeba7e0d952c6617e232fa8ed53257c35dd2f),platform=Linux 3.13.0-129-generic x86_64) ====================================================================== ERROR: testNetworkConnectionTypeIsAppliedToAllTabsImmediately (__main__.MobileEmulationCapabilityTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/run_py_tests.py", line 2261, in testNetworkConnectionTypeIsAppliedToAllTabsImmediately driver.FindElement('id', 'requestButton').Click() File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 346, in FindElement Command.FIND_ELEMENT, {'using': strategy, 'value': target}) File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 291, in ExecuteCommand response = self._ExecuteCommand(command, params) File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 284, in _ExecuteCommand raise _ExceptionForLegacyResponse(response) NoSuchElement: no such element: Unable to locate element: {"method":"id","selector":"requestButton"} (Session info: chrome=63.0.3214.0) (Driver info: chromedriver=2.32.500270 (4b0eeba7e0d952c6617e232fa8ed53257c35dd2f),platform=Linux 3.13.0-129-generic x86_64) ====================================================================== FAIL: testDeviceName (__main__.MobileEmulationCapabilityTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/b/build/slave/Linux/build/src/chrome/test/chromedriver/test/run_py_tests.py", line 2100, in testDeviceName body_tag.GetText()) AssertionError: 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36' != u'' ---------------------------------------------------------------------- ========== org.openqa.selenium.FrameSwitchingTest.testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation (5.945s) junit.framework.AssertionFailedError: Condition timed out: title to be: Google
,
Sep 12 2017
Can you please provide instructions on how to reproduce this locally for someone not very familiar with chromedriver? It'd be useful to get a filled in stack trace. Daniel - you might be interested in the "Check failed: global_proxy_.IsEmpty()". Any ideas on what might be causing it? The test that triggers this is FrameSwitchingTest.testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation (internal codesearch seems to have it), which apparently just loads a frame and clicks on a link there, which triggers a window.top.location = 'issue5237_target.html' via onclick. All same-origin.
,
Sep 12 2017
This means that something is touching the Window object before we swapped frames. I checked in some "temporary" debugging code for this 3 months ago: https://chromium-review.googlesource.com/c/chromium/src/+/536575 If this repros consistently, it should be easy to log out the captured stack trace and see what's causing early initialization at the CHECK.
,
Sep 12 2017
Please find the steps as follows: 1) In chromium checkout, run the below command for python tests: :~/chromium/src$ chrome/test/chromedriver/test/run_py_tests.py --chromedriver=/path/to/chromedriver --chrome=/path/to/chrome --log-path=$HOME/Desktop/chromedriver.log --filter=*.testDeviceName :~/chromium/src$ chrome/test/chromedriver/test/run_py_tests.py --chromedriver=/path/to/chromedriver --chrome=/path/to/chrome --log-path=$HOME/Desktop/chromedriver.log --filter=*.testNetworkConnectionTypeIsAppliedToAllTabs :~/chromium/src$ chrome/test/chromedriver/test/run_py_tests.py --chromedriver=/path/to/chromedriver --chrome=/path/to/chrome --log-path=$HOME/Desktop/chromedriver.log --filter=*.testNetworkConnectionTypeIsAppliedToAllTabsImmediately 2) And for java test: :~/chromium/src$ chrome/test/chromedriver/test/run_java_tests.py --chromedriver=/path/to/chromedriver --chrome=/path/to/chrome --filter=*.testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation --log-path=$HOME/Desktop/chromedriver.log Chromedriver binary can be downloaded from http://chromedriver.storage.googleapis.com/index.html?path=2.32/ This issue reproduces consistently. Please find the attached chrome_debug.log
,
Sep 12 2017
It's because origin trials is causing the context to be initialized in InstallNewDocument(), before we've actually committed the navigation and swapped frames: #1 0x7fdb8e23cddc blink::WindowProxy::InitializeIfNeeded() #2 0x7fdb8e814785 blink::Frame::GetWindowProxy() #3 0x7fdb8e8339b0 blink::LocalFrame::WindowProxy() #4 0x7fdb8e22355d blink::ToV8ContextEvenIfDetached() #5 0x7fdb8e223422 blink::ToScriptStateImpl() #6 0x7fdb8e22362f blink::ToScriptState() #7 0x7fdb8ee1390e blink::OriginTrialContext::InitializePendingFeatures() #8 0x7fdb8ee13bb6 blink::OriginTrialContext::AddFeature() #9 0x7fdb8edb8368 blink::DocumentLoader::DidInstallNewDocument() #10 0x7fdb8edb7535 blink::DocumentLoader::InstallNewDocument() #11 0x7fdb8edb7095 blink::DocumentLoader::CommitNavigation() #12 0x7fdb8edb5dd3 blink::DocumentLoader::CommitData() #13 0x7fdb8edb7957 blink::DocumentLoader::ProcessData() #14 0x7fdb8edb7815 blink::DocumentLoader::DataReceived() #15 0x7fdb8d72c842 blink::RawResource::AppendData() #16 0x7fdb8d753940 blink::ResourceLoader::DidReceiveData() #17 0x7fdb92b2b953 content::WebURLLoaderImpl::Context::OnReceivedData() #18 0x7fdb92b2c27b content::WebURLLoaderImpl::RequestPeerImpl::OnReceivedData() #19 0x7fdb92b20c67 content::URLResponseBodyConsumer::OnReadable() #20 0x7fdb92b20468 content::URLLoaderClientImpl::OnStartLoadingResponseBody() #21 0x7fdb92bd25b6 content::ThrottlingURLLoader::OnStartLoadingResponseBody() #22 0x7fdb92cd9372 content::mojom::URLLoaderClientStubDispatch::Accept() (This is the cause of another crash alexmos is investigating as well)
,
Sep 12 2017
,
Sep 12 2017
,
Sep 13 2017
To follow up on #5, the other crash I'm seeing due to this is when doing DevTools audits, once my fix for a preceding crash (https://chromium-review.googlesource.com/662904) lands. Issue 764202 has the repro steps for it. Since DidInstallNewDocument happens just before DidCommitNavigation in InstallNewDocument(), could we just do the OriginTrialContext::AddFeature a little bit later, after DidCommitNavigation?
,
Sep 14 2017
,
Sep 14 2017
,
Sep 14 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/03793ac434be2878935f084870828b0cd5e0d7c8 commit 03793ac434be2878935f084870828b0cd5e0d7c8 Author: Gauri Manikpure <gmanikpure@chromium.org> Date: Thu Sep 14 23:15:29 2017 [Chromedriver] Disable tests on HEAD that fails due to a Chrome browser crash. Bug: 764519 Change-Id: Id3ff2f511c71aeb550a98efbd38bea50774ec115 Reviewed-on: https://chromium-review.googlesource.com/668063 Reviewed-by: Shuotao Gao <stgao@chromium.org> Commit-Queue: Gauri Manikpure <gmanikpure@chromium.org> Cr-Commit-Position: refs/heads/master@{#502090} [modify] https://crrev.com/03793ac434be2878935f084870828b0cd5e0d7c8/chrome/test/chromedriver/test/run_py_tests.py [modify] https://crrev.com/03793ac434be2878935f084870828b0cd5e0d7c8/chrome/test/chromedriver/test/test_expectations
,
Sep 15 2017
+dgozman who added the problematic call to OriginTrialContext::From(document)->AddFeature("ForceTouchEventFeatureDetectionForInspector") in https://chromium-review.googlesource.com/c/chromium/src/+/600989.
Dmitry, any thoughts about #8 or other ways to fix this?
,
Sep 15 2017
Sure, we can move this call later. I'd even say we should not force any WindowProxy initialization at all, since it will ask for enabled origin trials when initializing anyway. I will take a look at how to avoid this tomorrow.
,
Sep 15 2017
#13: Thanks a lot! I'll reassign this to you for now.
,
Sep 15 2017
,
Sep 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ddb3b868e596bf4f7f3e64ab570b647f7d26b3f7 commit ddb3b868e596bf4f7f3e64ab570b647f7d26b3f7 Author: Dmitry Gozman <dgozman@chromium.org> Date: Mon Sep 18 19:55:26 2017 Move origin trials initialization later in document loading process Enabling any origin trial feature forces WindowProxy initialization, which should not be done before frame has been swapped in. This means we should only initialize origin trials after DidCommitNavigation call. Added a cross-site navigation to the test to catch this regression. BUG= 764519 Change-Id: Iea1c390eb27c0ecf9789215fb1349e0f01c16354 Reviewed-on: https://chromium-review.googlesource.com/669777 Reviewed-by: Ian Clelland <iclelland@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#502651} [modify] https://crrev.com/ddb3b868e596bf4f7f3e64ab570b647f7d26b3f7/content/browser/devtools/protocol/devtools_protocol_browsertest.cc [modify] https://crrev.com/ddb3b868e596bf4f7f3e64ab570b647f7d26b3f7/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
,
Sep 28 2017
,
Jan 30 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f84d86f12882a60cf51eb17e43a48716a41ae1a0 commit f84d86f12882a60cf51eb17e43a48716a41ae1a0 Author: Artur Khachatryan <khachatryan@chromium.org> Date: Tue Jan 30 22:54:46 2018 [ChromeDriver] Enable several MobileEmulationCapabilityTest tests in HEAD Bug 764519 was fixed so relevant disabled tests are now enabled by this commit. Bug: 764519 Change-Id: I1af80b6ecbbf9548aeae8d5ab08641180dde9f2c Reviewed-on: https://chromium-review.googlesource.com/894263 Reviewed-by: John Chen <johnchen@chromium.org> Commit-Queue: Artur Khachatryan <khachatryan@chromium.org> Cr-Commit-Position: refs/heads/master@{#533057} [modify] https://crrev.com/f84d86f12882a60cf51eb17e43a48716a41ae1a0/chrome/test/chromedriver/test/run_py_tests.py |
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by gmanikpure@chromium.org
, Sep 12 2017Owner: alex...@chromium.org
Status: Assigned (was: Untriaged)
Summary: FATAL:WindowProxy.cpp(105)] Check failed: global_proxy_.IsEmpty() on Chrome 63+ (was: NoSuchElement on Chrome 63+)
99 KB
99 KB View Download
27.4 KB
27.4 KB View Download