diff options
author | zhenghao@google.com <zhenghao@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-16 02:54:08 +0000 |
---|---|---|
committer | zhenghao@google.com <zhenghao@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-16 02:54:08 +0000 |
commit | 0577cfd2617c0c1ddcb04002a81738db95a1ab42 (patch) | |
tree | a1af7507440bf289672706b7f40954186fd0bd73 /webkit/support | |
parent | b51b6893eca496daf1367b4b1888d87430baec57 (diff) | |
download | chromium_src-0577cfd2617c0c1ddcb04002a81738db95a1ab42.zip chromium_src-0577cfd2617c0c1ddcb04002a81738db95a1ab42.tar.gz chromium_src-0577cfd2617c0c1ddcb04002a81738db95a1ab42.tar.bz2 |
Convert file request to http request for layout test for Android.
For the limited environment of Android, we cannot host all layout test
material on Android. We implemented a 'forwarder', which can forward all
http request on Android to the same port on the host machine running
Linux/Mac. However, most layout tests are file-based tests, so we need
to convert file request to http request for layout tests.
We enable file-over-http to bridge the file protocol to http protocol
in here, which can
(1) run the layout tests on android target device, but never need to
push the test files and corresponding resources to device, which saves
huge running time.
(2) still run non-http layout (tests not under LayoutTests/http) tests
via file protocol without breaking test environment / convention of webkit
layout tests, which are followed by current all webkit ports.
BUG=
TEST=
Review URL: http://codereview.chromium.org/7901009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support')
-rw-r--r-- | webkit/support/platform_support_android.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/webkit/support/platform_support_android.cc b/webkit/support/platform_support_android.cc index 1483780..d069dbc 100644 --- a/webkit/support/platform_support_android.cc +++ b/webkit/support/platform_support_android.cc @@ -10,8 +10,10 @@ #include "base/path_service.h" #include "base/string16.h" #include "base/string_piece.h" +#include "googleurl/src/gurl.h" #include "grit/webkit_resources.h" #include "ui/base/resource/resource_bundle.h" +#include "webkit/tools/test_shell/simple_resource_loader_bridge.h" namespace webkit_support { @@ -27,6 +29,18 @@ void AfterInitialize(bool unit_test_mode) { PathService::Get(base::DIR_EXE, &data_path); data_path = data_path.Append("DumpRenderTree.pak"); ResourceBundle::InitSharedInstanceForTest(data_path); + + // We enable file-over-http to bridge the file protocol to http protocol + // in here, which can + // (1) run the layout tests on android target device, but never need to + // push the test files and corresponding resources to device, which saves + // huge running time. + // (2) still run non-http layout (tests not under LayoutTests/http) tests + // via file protocol without breaking test environment / convention of webkit + // layout tests, which are followed by current all webkit ports. + SimpleResourceLoaderBridge::AllowFileOverHTTP( + "third_party/WebKit/LayoutTests/", + GURL("http://127.0.0.1:8000/all-tests/")); } void BeforeShutdown() { |