New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 614778 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Regression

Blocking:
issue 498120
issue 613408



Sign in to add a comment

content_shell stopped being able to run layout tests for files under /media

Project Member Reported by rbyers@chromium.org, May 25 2016

Issue description

run content_shell --run-layout-test passing a filename that includes a symlink somewhere.  

Sometime in the past few weeks this broken, apparently resulting in content_shell seeing an empty document (always get a trivial layout test generated):

#READY
[17912:17912:0525/150047:1656602852095:ERROR:service_registry_impl.cc(95)] blink::mojom::VRService not found
Content-Type: text/plain
layer at (0,0) size 800x600
  LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
  LayoutBlockFlow {HTML} at (0,0) size 800x600
    LayoutBlockFlow {BODY} at (8,8) size 784x584
#EOF
#EOF
#EOF

If I switch to using a true physical path (eg. cd `pwd -P`) then it's fine.

Next I plan to bisect to find what CL broke this.

 

Comment 2 by rbyers@chromium.org, May 25 2016

Owner: rbyers@chromium.org
Status: Started (was: Unconfirmed)
bisecting now

Comment 3 by rbyers@chromium.org, May 25 2016

Cc: jsb...@chromium.org
Labels: -Type-Bug -Pri-3 Pri-1 Type-Bug-Regression
Owner: tkent@chromium.org
Status: Assigned (was: Started)
This CL is what caused this to break.  tkent@ can you please take a look and see if you can fix your code to still support paths with symlinks?

Author: tkent <tkent@chromium.org>
Date:   Fri May 20 00:15:54 2016 -0700

    content_shell: Redirect resource requests for some local paths.
    
    This CL changes content_shell in layout test mode so that it redirects resource
    requests for file:///{common,images,media,resources}/ to third_party/WebKit/
    LayoutTests/imported/wpt/*.
    
    Such URLs are resolved from absolute path links in web-platform-tests like
    <script src="/resources/testharness.js">.
    
    After this CL, we can remove path rewrite step for /resources and /common in
    test_converter.py.
    
    BUG= 498120 ,  613408 
    
    Review-Url: https://codereview.chromium.org/1984103003
    Cr-Commit-Position: refs/heads/master@{#395025}

Comment 4 by tkent@chromium.org, May 25 2016

What symlink do you have, and what path do you specify in the command line, and what's the working directory on invoking content_shell?

Comment 5 by tkent@chromium.org, May 25 2016

Labels: Needs-Feedback
I couldn't reproduce this on my Linux box with a symlinked checkout.

Comment 6 by rbyers@chromium.org, May 26 2016

I have ~/code/chrome-internal sym-linked to /media/ssd/code/chrome-internal and I'm seeing things like this:

rbyers@rbyers-dev:~/code/chrome-internal/src/third_party/WebKit/LayoutTests$ ~/code/chrome-internal/src/out/Debug_gn/content_shell --run-layout-test fast/events/touch/touch-target.html 
#READY
[30627:30627:0525/204414:1677209501649:ERROR:service_registry_impl.cc(95)] blink::mojom::VRService not found
Content-Type: text/plain
layer at (0,0) size 800x600
  LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
  LayoutBlockFlow {HTML} at (0,0) size 800x600
    LayoutBlockFlow {BODY} at (8,8) size 784x584
#EOF
#EOF
#EOF


Comment 7 by rbyers@chromium.org, May 26 2016

Oh crap, now it's not working from a non-symlinked directory either.  Maybe that was a red-herring.  I'll start debugging your patch to see what has actually changed for me.

Comment 8 by rbyers@chromium.org, May 26 2016

Oh, it's because you write all paths that start with media and my enlistment is on /media/ssd!

Comment 9 by rbyers@chromium.org, May 26 2016

Blocking: 613408
Perhaps we should only rewrite the URL when we see that a file actually exists at that path?  That would make collisions like this much less likely.

Also we should probably never rewrite the top-level URL for the page under test - it's content_shell converting that into an absolute path that's causing the problem for me here.

Comment 11 by tkent@chromium.org, May 26 2016

Thank you for the investigation!

> Perhaps we should only rewrite the URL when we see that a file actually exists at that path?

Unfortunately we can't access local files because of the sandbox.


Comment 12 by tkent@chromium.org, May 26 2016

Summary: content_shell stopped being able to run layout tests for files under /media (was: content_shell stopped being able to run layout tests for files inside of symlink directories)

Comment 13 by tkent@chromium.org, May 26 2016

I though we could enable the path rewriting only during running WPT tests.  However, I found it didn't work.

e.g.

A test:
  file:///media/ssd/.../LT/imported/wpt/html/foo.html
The test contains:
   <img src="/media/poster.png">
   <iframe src="bar.html"></iframe>

file:///media/poster.png should be updated, but file:///media/ssd/.../LT/imported/wpt/html/bar.html should not be updated.


I'll try both of
 - The first resource request should not be rewritten.
 - Paths including "/LayoutTests/" should not be rewritten.


Comment 14 by tkent@chromium.org, May 26 2016

Status: Started (was: Assigned)

Comment 15 by tkent@chromium.org, May 26 2016

Labels: -Needs-Feedback
Project Member

Comment 16 by bugdroid1@chromium.org, May 26 2016

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

commit 00340348688b60b044587900939330cd4ea1e989
Author: tkent <tkent@chromium.org>
Date: Thu May 26 08:18:41 2016

content_shell: Fix a regression for paths starting with /media/.

crrev.com/395025 caused a regression that layout tests in /media are not runnable.

- Do not rewrite a request URL if it's the first request after Reset().
- Do not rewrite a request URL if it contains "/LayoutTests/".

BUG= 613408 ,  614778 

Review-Url: https://codereview.chromium.org/2012653004
Cr-Commit-Position: refs/heads/master@{#396146}

[modify] https://crrev.com/00340348688b60b044587900939330cd4ea1e989/components/test_runner/test_runner.cc
[modify] https://crrev.com/00340348688b60b044587900939330cd4ea1e989/components/test_runner/test_runner.h
[modify] https://crrev.com/00340348688b60b044587900939330cd4ea1e989/components/test_runner/web_frame_test_client.cc
[modify] https://crrev.com/00340348688b60b044587900939330cd4ea1e989/content/shell/renderer/layout_test/blink_test_runner.cc

Comment 18 by tkent@chromium.org, May 29 2016

Status: Fixed (was: Started)
Blocking: 498120

Sign in to add a comment