summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/test_webview_delegate.cc
diff options
context:
space:
mode:
authordpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 01:47:16 +0000
committerdpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 01:47:16 +0000
commit45fbad0fdf0c83236a997e043805cfade80fc5d8 (patch)
tree1b6010795fefb1664a3e25d705381c5c2dff2a99 /webkit/tools/test_shell/test_webview_delegate.cc
parent8dc1411ff5c8dc7e3a1cc2724c77f7ce0193c4ba (diff)
downloadchromium_src-45fbad0fdf0c83236a997e043805cfade80fc5d8.zip
chromium_src-45fbad0fdf0c83236a997e043805cfade80fc5d8.tar.gz
chromium_src-45fbad0fdf0c83236a997e043805cfade80fc5d8.tar.bz2
Add an --allow-external-pages switch to test_shell.
Normally test_shell will not let you load an external URL (like "www.google.com") when running in --layout-tests mode. This is a good thing because it keeps us from writing tests that might have unpredictable results if the external URL changes. However, it would be cool to be able to use the --layout-test infrastructure to capture the rendered/painted page (outside of the actual layout tests run) for QA purposes. This change adds an --allow-external-pages switch to override the check described above. This is kind of a short-term fix. A better fix would be to add a "--headless" flag that loaded and rendered the page and dumped the whole thing, entirely separate from --layout-test mode. I will add that soon. BUG=none TEST=none R=dglazkov Review URL: http://codereview.chromium.org/1748005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45403 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_webview_delegate.cc')
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index 3b52c75..408c0b0 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -962,7 +962,8 @@ void TestWebViewDelegate::willSendRequest(
host != "127.0.0.1" &&
host != "255.255.255.255" && // Used in some tests that expect to get
// back an error.
- host != "localhost") {
+ host != "localhost" &&
+ !TestShell::allow_external_pages()) {
printf("Blocked access to external URL %s\n", request_url.c_str());
// To block the request, we set its URL to an empty one.