Skip to content

Commit

Permalink
Wait for test script to be loaded before calling __get_timings by set…
Browse files Browse the repository at this point in the history
…ting a variable to indicate that the result report page is loaded. See detailed analysis in crbug.com/53140.

BUG=53140
Review URL: http://codereview.chromium.org/7904005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101718 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jnd@chromium.org committed Sep 19, 2011
1 parent 7f8f556 commit 4187ef0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 8 additions & 5 deletions chrome/test/perf/page_cycler_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ class PageCyclerTest : public UIPerfTest {
pages->assign(UTF8ToWide(cookie));
ASSERT_FALSE(pages->empty());

// Wait for the report.html to be loaded.
ASSERT_TRUE(WaitUntilCookieValue(
tab.get(), test_url, "__navigated_to_report",
TestTimeouts::action_max_timeout_ms(), "1"));

// Get the timing cookie value from the DOM automation.
std::wstring wcookie;
ASSERT_TRUE(tab->ExecuteAndExtractString(L"",
Expand Down Expand Up @@ -442,20 +447,18 @@ TEST_F(PageCyclerReferenceTest, name) { \

// This macro simplifies setting up regular and reference build tests
// for HTML5 database tests.
// FLAKY http://crbug.com/67918
#define PAGE_CYCLER_DATABASE_TESTS(test, name) \
TEST_F(PageCyclerDatabaseTest, FLAKY_Database##name##File) { \
TEST_F(PageCyclerDatabaseTest, Database##name##File) { \
RunTest(test, test, false); \
} \
TEST_F(PageCyclerDatabaseReferenceTest, FLAKY_Database##name##File) { \
TEST_F(PageCyclerDatabaseReferenceTest, Database##name##File) { \
RunTest(test, test, false); \
}

// This macro simplifies setting up regular and reference build tests
// for HTML5 Indexed DB tests.
// FLAKY http://crbug.com/67918
#define PAGE_CYCLER_IDB_TESTS(test, name) \
TEST_F(PageCyclerIndexedDatabaseTest, FLAKY_IndexedDB##name##File) { \
TEST_F(PageCyclerIndexedDatabaseTest, IndexedDB##name##File) { \
RunTest(test, test, false); \
} \
TEST_F(PageCyclerIndexedDatabaseReferenceTest, IndexedDB##name##File) { \
Expand Down
5 changes: 4 additions & 1 deletion tools/page_cycler/common/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ function __ontimeout() {
document.location.href = url;
}
function __onload() {
if (__results)
if (__results) {
// Set a variable to indicate that the result report page is loaded.
document.cookie = " __navigated_to_report=1; path=/";
return;
}
var unused = document.body.offsetHeight; // force layout

var ts = 0, td = 0, te = (new Date()).getTime(), tf = 0;
Expand Down

0 comments on commit 4187ef0

Please sign in to comment.