summaryrefslogtreecommitdiffstats
path: root/chrome/test/page_cycler
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-07 15:55:32 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-07 15:55:32 +0000
commit44986391568796028c6ecf84f4112facdaee7e22 (patch)
tree0fd78663eab1976e166343a6d1b67bb3eaff2ddc /chrome/test/page_cycler
parenta2c6a828bafded3d0070de96fccf1d36d4416076 (diff)
downloadchromium_src-44986391568796028c6ecf84f4112facdaee7e22.zip
chromium_src-44986391568796028c6ecf84f4112facdaee7e22.tar.gz
chromium_src-44986391568796028c6ecf84f4112facdaee7e22.tar.bz2
Revert change 11199 because it breaks the page cyclers
on windows. My theory is that the GURL in RunPageCycler is not correct. (Missing a "/" maybe.) Review URL: http://codereview.chromium.org/40268 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/page_cycler')
-rw-r--r--chrome/test/page_cycler/page_cycler_test.cc83
-rw-r--r--chrome/test/page_cycler/page_cycler_tests.scons12
2 files changed, 40 insertions, 55 deletions
diff --git a/chrome/test/page_cycler/page_cycler_test.cc b/chrome/test/page_cycler/page_cycler_test.cc
index 5899071..8f5fead 100644
--- a/chrome/test/page_cycler/page_cycler_test.cc
+++ b/chrome/test/page_cycler/page_cycler_test.cc
@@ -11,10 +11,7 @@
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
-#if defined(OS_WIN)
-// TODO(port): Enable when chrome_process_filter.h is ported.
#include "chrome/common/chrome_process_filter.h"
-#endif // defined(OS_WIN)
#include "chrome/common/chrome_switches.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/automation/window_proxy.h"
@@ -31,7 +28,7 @@
// URL at which data files may be found for HTTP tests. The document root of
// this URL's server should point to data/page_cycler/.
-static const char kBaseUrl[] = "http://localhost:8000/";
+#define BASE_URL L"http://localhost:8000"
namespace {
@@ -46,20 +43,23 @@ class PageCyclerTest : public UITest {
}
// For HTTP tests, the name must be safe for use in a URL without escaping.
- void RunPageCycler(const char* name, std::wstring* pages,
+ void RunPageCycler(const wchar_t* name, std::wstring* pages,
std::wstring* timings, bool use_http) {
GURL test_url;
if (use_http) {
- test_url = GURL(std::string(kBaseUrl) + name + "start.html");
+ std::wstring test_path(BASE_URL);
+ file_util::AppendToPath(&test_path, name);
+ file_util::AppendToPath(&test_path, L"start.html");
+ test_url = GURL(test_path);
} else {
- FilePath test_path;
+ std::wstring test_path;
PathService::Get(base::DIR_EXE, &test_path);
- test_path = test_path.DirName();
- test_path = test_path.DirName();
- test_path = test_path.Append(FILE_PATH_LITERAL("data"));
- test_path = test_path.Append(FILE_PATH_LITERAL("page_cycler"));
- test_path = test_path.AppendASCII(name);
- test_path = test_path.Append(FILE_PATH_LITERAL("start.html"));
+ file_util::UpOneDirectory(&test_path);
+ file_util::UpOneDirectory(&test_path);
+ file_util::AppendToPath(&test_path, L"data");
+ file_util::AppendToPath(&test_path, L"page_cycler");
+ file_util::AppendToPath(&test_path, name);
+ file_util::AppendToPath(&test_path, L"start.html");
test_url = net::FilePathToFileURL(test_path);
}
@@ -80,15 +80,13 @@ class PageCyclerTest : public UITest {
std::string cookie;
ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_pages", &cookie));
- pages->assign(UTF8ToWide(cookie));
+ pages->swap(UTF8ToWide(cookie));
ASSERT_FALSE(pages->empty());
ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_timings", &cookie));
- timings->assign(UTF8ToWide(cookie));
+ timings->swap(UTF8ToWide(cookie));
ASSERT_FALSE(timings->empty());
}
-#if defined(OS_WIN)
- // TODO(port): Code below depends on BrowserProcessFilter and has windowsisms.
void PrintIOPerfInfo(const wchar_t* test_name) {
BrowserProcessFilter chrome_filter(L"");
base::NamedProcessIterator
@@ -198,23 +196,19 @@ class PageCyclerTest : public UITest {
}
}
}
-#endif // defined(OS_WIN)
// When use_http is true, the test name passed here will be used directly in
// the path to the test data, so it must be safe for use in a URL without
// escaping. (No pound (#), question mark (?), semicolon (;), non-ASCII, or
// other funny stuff.)
- void RunTest(const char* name, bool use_http) {
+ void RunTest(const wchar_t* name, bool use_http) {
std::wstring pages, timings;
RunPageCycler(name, &pages, &timings, use_http);
if (timings.empty())
return;
-#if defined(OS_WIN)
- // TODO(port): Enable when Print{MemoryUsage,IOPerf}Info are ported.
PrintMemoryUsageInfo(L"");
PrintIOPerfInfo(L"");
-#endif // defined(OS_WIN)
wprintf(L"\nPages: [%ls]\n", pages.c_str());
PrintResultList(L"times", L"", L"t", timings, L"ms",
@@ -235,17 +229,14 @@ class PageCyclerReferenceTest : public PageCyclerTest {
UITest::SetUp();
}
- void RunTest(const char* name, bool use_http) {
+ void RunTest(const wchar_t* name, bool use_http) {
std::wstring pages, timings;
RunPageCycler(name, &pages, &timings, use_http);
if (timings.empty())
return;
-#if defined(OS_WIN)
- // TODO(port): Enable when Print{MemoryUsage,IOPerf}Info are ported.
PrintMemoryUsageInfo(L"_ref");
PrintIOPerfInfo(L"_ref");
-#endif // defined(OS_WIN)
PrintResultList(L"times", L"", L"t_ref", timings, L"ms",
true /* important */);
@@ -256,83 +247,83 @@ class PageCyclerReferenceTest : public PageCyclerTest {
// file-URL tests
TEST_F(PageCyclerTest, MozFile) {
- RunTest("moz", false);
+ RunTest(L"moz", false);
}
TEST_F(PageCyclerReferenceTest, MozFile) {
- RunTest("moz", false);
+ RunTest(L"moz", false);
}
TEST_F(PageCyclerTest, Intl1File) {
- RunTest("intl1", false);
+ RunTest(L"intl1", false);
}
TEST_F(PageCyclerReferenceTest, Intl1File) {
- RunTest("intl1", false);
+ RunTest(L"intl1", false);
}
TEST_F(PageCyclerTest, Intl2File) {
- RunTest("intl2", false);
+ RunTest(L"intl2", false);
}
TEST_F(PageCyclerReferenceTest, Intl2File) {
- RunTest("intl2", false);
+ RunTest(L"intl2", false);
}
TEST_F(PageCyclerTest, DomFile) {
- RunTest("dom", false);
+ RunTest(L"dom", false);
}
TEST_F(PageCyclerReferenceTest, DomFile) {
- RunTest("dom", false);
+ RunTest(L"dom", false);
}
TEST_F(PageCyclerTest, DhtmlFile) {
- RunTest("dhtml", false);
+ RunTest(L"dhtml", false);
}
TEST_F(PageCyclerReferenceTest, DhtmlFile) {
- RunTest("dhtml", false);
+ RunTest(L"dhtml", false);
}
// http (localhost) tests
TEST_F(PageCyclerTest, MozHttp) {
- RunTest("moz", true);
+ RunTest(L"moz", true);
}
TEST_F(PageCyclerReferenceTest, MozHttp) {
- RunTest("moz", true);
+ RunTest(L"moz", true);
}
TEST_F(PageCyclerTest, Intl1Http) {
- RunTest("intl1", true);
+ RunTest(L"intl1", true);
}
TEST_F(PageCyclerReferenceTest, Intl1Http) {
- RunTest("intl1", true);
+ RunTest(L"intl1", true);
}
TEST_F(PageCyclerTest, Intl2Http) {
- RunTest("intl2", true);
+ RunTest(L"intl2", true);
}
TEST_F(PageCyclerReferenceTest, Intl2Http) {
- RunTest("intl2", true);
+ RunTest(L"intl2", true);
}
TEST_F(PageCyclerTest, DomHttp) {
- RunTest("dom", true);
+ RunTest(L"dom", true);
}
TEST_F(PageCyclerReferenceTest, DomHttp) {
- RunTest("dom", true);
+ RunTest(L"dom", true);
}
TEST_F(PageCyclerTest, BloatHttp) {
- RunTest("bloat", true);
+ RunTest(L"bloat", true);
}
TEST_F(PageCyclerReferenceTest, BloatHttp) {
- RunTest("bloat", true);
+ RunTest(L"bloat", true);
}
diff --git a/chrome/test/page_cycler/page_cycler_tests.scons b/chrome/test/page_cycler/page_cycler_tests.scons
index 984baf1..b265b25 100644
--- a/chrome/test/page_cycler/page_cycler_tests.scons
+++ b/chrome/test/page_cycler/page_cycler_tests.scons
@@ -10,7 +10,6 @@ env.ApplySConscript([
'$BASE_DIR/using_base.scons',
'$BASE_DIR/gfx/using_base_gfx.scons',
'$CHROME_SRC_DIR/build/using_googleurl.scons',
- '$CHROME_SRC_DIR/tools/grit/build/using_generated_resources.scons',
'$GTEST_DIR/../using_gtest.scons',
'$ICU38_DIR/using_icu38.scons',
'$LIBPNG_DIR/using_libpng.scons',
@@ -32,8 +31,6 @@ env.Prepend(
'browser',
'browser_views',
'common',
- 'glue',
- 'WTF',
],
)
@@ -92,12 +89,9 @@ if not env.Bit('windows'):
'$CHROME_DIR/tools/build/win/precompiled_wtl.h',
)
- # TODO(port): Remove files from this list as they get ported.
- input_files.Remove(
- '$CHROME_DIR/test/perf/mem_usage$OBJSUFFIX',
- )
-
-env.ChromeTestProgram('page_cycler_tests', input_files)
+# TODO(port):
+if env.Bit('windows'):
+ env.ChromeTestProgram('page_cycler_tests', input_files)
p = env.ChromeMSVSProject('page_cycler_tests.vcproj',
dest=('$CHROME_SRC_DIR/chrome/'