Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Issue 1841403002: Carry over user-agent override when opening new windows

Created:
4 years, 8 months ago by allan.jensen
Modified:
4 years, 8 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, esprehn, jam, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Carry over user-agent override when opening new windows RenderFrameImpl will try to set user-agen override based on the last request on the frame, but when a new window is opened there is only a blank last request where override has not been set. This patch will set the user-agent override on the initial blank request on a new frame based on the setting of opener. BUG=599036 R=esprehn@chromium.org R=avi@chromium.org

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -0 lines) Patch
M content/renderer/render_frame_impl.cc View 1 chunk +20 lines, -0 lines 1 comment Download

Messages

Total messages: 12 (2 generated)
allan.jensen
4 years, 8 months ago (2016-03-30 09:51:02 UTC) #1
Avi (use Gerrit)
This looks reasonable, but I'm not knowledgeable enough about the internals of Blink. LGTM as ...
4 years, 8 months ago (2016-03-30 16:11:57 UTC) #2
Charlie Reis
[Adding mnaganov, who I think is familiar with user agent override on Android.]
4 years, 8 months ago (2016-03-30 19:16:12 UTC) #4
mnaganov (inactive)
Looks reasonable, let's check that the tests pass.
4 years, 8 months ago (2016-03-30 23:53:32 UTC) #5
esprehn
Honestly I have no idea what this DataSource code does. This seems kind of gross ...
4 years, 8 months ago (2016-03-31 05:09:11 UTC) #7
dcheng
Also, test? =) https://codereview.chromium.org/1841403002/diff/1/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1841403002/diff/1/content/renderer/render_frame_impl.cc#newcode2629 content/renderer/render_frame_impl.cc:2629: blink::WebView* webview = render_view_->webview(); This doesn't ...
4 years, 8 months ago (2016-03-31 05:24:18 UTC) #8
allan.jensen
On 2016/03/31 at 05:24:18, dcheng wrote: > Also, test? =) > > https://codereview.chromium.org/1841403002/diff/1/content/renderer/render_frame_impl.cc > File ...
4 years, 8 months ago (2016-04-04 10:58:16 UTC) #9
allan.jensen
Are there any documentation on how to write tests for chromium? The patch was developed ...
4 years, 8 months ago (2016-04-04 11:39:05 UTC) #10
dcheng
On 2016/04/04 at 10:58:16, allan.jensen wrote: > On 2016/03/31 at 05:24:18, dcheng wrote: > > ...
4 years, 8 months ago (2016-04-04 19:26:25 UTC) #11
dcheng
4 years, 8 months ago (2016-04-04 19:33:22 UTC) #12
On 2016/04/04 at 11:39:05, allan.jensen wrote:
> Are there any documentation on how to write tests for chromium?
> 
> The patch was developed using the test attached to
https://bugreports.qt.io/browse/QTBUG-50876 ,
https://bugreports.qt.io/secure/attachment/54068/index.html
> 
> And hitting submit using CTRL+click.

As for testing, you could exercise this with a layout test or browser test: I
wouldn't write this as a unit test since we specifically need to test behavior
in //content.

Layout test:
Easy to compare expected results (just dump navigator.userAgent) but harder to
set up the test (you need to add plumbing for setting the user agent override
from the layout test runner: see
https://code.google.com/p/chromium/codesearch#chromium/src/components/test_ru...)

Browser test:
Easy to set the user agent override but checking the expected result is a bit
harder (the usual hack is to set the string to check as the title of the page,
and then use TitleWatcher from
https://code.google.com/p/chromium/codesearch#chromium/src/content/public/tes...)

Powered by Google App Engine
This is Rietveld 408576698