summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 20:14:25 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 20:14:25 +0000
commit44d80ea05e0862f76657f7b0009b5274269cb08e (patch)
tree61468c02e805157dc3da19c5bcd5164f61b4256d
parentaa9d4a9eab291ef35d6aed3fb390e0c7a76c8cc1 (diff)
downloadchromium_src-44d80ea05e0862f76657f7b0009b5274269cb08e.zip
chromium_src-44d80ea05e0862f76657f7b0009b5274269cb08e.tar.gz
chromium_src-44d80ea05e0862f76657f7b0009b5274269cb08e.tar.bz2
Add support for running HTTP based tests.
Enable the Buffer test since it seems to work. Convert to using test_case.html to drive all tests. R=brettw BUG=none TEST=none Review URL: http://codereview.chromium.org/2805063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51556 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--chrome/test/ui/ppapi_uitest.cc32
2 files changed, 27 insertions, 7 deletions
diff --git a/DEPS b/DEPS
index 8102800..8dbfdde 100644
--- a/DEPS
+++ b/DEPS
@@ -158,7 +158,7 @@ deps = {
Var("libvpx_revision"),
"src/third_party/ppapi":
- "http://ppapi.googlecode.com/svn/trunk@97",
+ "http://ppapi.googlecode.com/svn/trunk@98",
"src/third_party/libjingle/source":
"http://libjingle.googlecode.com/svn/branches/nextsnap@" +
diff --git a/chrome/test/ui/ppapi_uitest.cc b/chrome/test/ui/ppapi_uitest.cc
index 549444c..7653bcd 100644
--- a/chrome/test/ui/ppapi_uitest.cc
+++ b/chrome/test/ui/ppapi_uitest.cc
@@ -9,6 +9,7 @@
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h"
#include "net/base/net_util.h"
+#include "net/url_request/url_request_unittest.h"
#include "webkit/glue/plugins/plugin_switches.h"
namespace {
@@ -53,18 +54,34 @@ class PPAPITest : public UITest {
launch_arguments_.AppendSwitch(switches::kEnablePepperTesting);
}
- void RunTest(const FilePath::StringType& test_file_name) {
+ void RunTest(const std::string& test_case) {
FilePath test_path;
PathService::Get(base::DIR_SOURCE_ROOT, &test_path);
test_path = test_path.Append(FILE_PATH_LITERAL("third_party"));
test_path = test_path.Append(FILE_PATH_LITERAL("ppapi"));
test_path = test_path.Append(FILE_PATH_LITERAL("tests"));
- test_path = test_path.Append(test_file_name);
+ test_path = test_path.Append(FILE_PATH_LITERAL("test_case.html"));
// Sanity check the file name.
EXPECT_TRUE(file_util::PathExists(test_path));
+ GURL::Replacements replacements;
+ replacements.SetQuery(test_case.c_str(),
+ url_parse::Component(0, test_case.size()));
GURL test_url = net::FilePathToFileURL(test_path);
+ RunTestURL(test_url.ReplaceComponents(replacements));
+ }
+
+ void RunTestViaHTTP(const std::string& test_case) {
+ const wchar_t kDocRoot[] = L"third_party/ppapi/tests";
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateForkingServer(kDocRoot);
+ ASSERT_TRUE(server);
+ RunTestURL(server->TestServerPage("files/test_case.html?" + test_case));
+ }
+
+ private:
+ void RunTestURL(const GURL& test_url) {
scoped_refptr<TabProxy> tab(GetActiveTab());
ASSERT_TRUE(tab.get());
ASSERT_TRUE(tab->NavigateToURL(test_url));
@@ -81,7 +98,7 @@ TEST_F(PPAPITest, DISABLED_DeviceContext2D) {
#else
TEST_F(PPAPITest, DeviceContext2D) {
#endif
- RunTest(FILE_PATH_LITERAL("test_device_context_2d.html"));
+ RunTest("DeviceContext2D");
}
#if defined(OS_MACOSX)
@@ -90,10 +107,13 @@ TEST_F(PPAPITest, DISABLED_ImageData) {
#else
TEST_F(PPAPITest, ImageData) {
#endif
- RunTest(FILE_PATH_LITERAL("test_image_data.html"));
+ RunTest("ImageData");
}
-TEST_F(PPAPITest, DISABLED_Buffer) {
- RunTest(FILE_PATH_LITERAL("test_buffer.html"));
+TEST_F(PPAPITest, Buffer) {
+ RunTest("Buffer");
}
+TEST_F(PPAPITest, URLLoader) {
+ RunTestViaHTTP("URLLoader");
+}