| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // Wait for the test to finish. | 190 // Wait for the test to finish. |
| 191 ASSERT_TRUE(WaitUntilCookieValue( | 191 ASSERT_TRUE(WaitUntilCookieValue( |
| 192 tab.get(), test_url, "__pc_done", | 192 tab.get(), test_url, "__pc_done", |
| 193 TestTimeouts::large_test_timeout_ms(), "1")); | 193 TestTimeouts::large_test_timeout_ms(), "1")); |
| 194 | 194 |
| 195 std::string cookie; | 195 std::string cookie; |
| 196 ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_pages", &cookie)); | 196 ASSERT_TRUE(tab->GetCookieByName(test_url, "__pc_pages", &cookie)); |
| 197 pages->assign(UTF8ToWide(cookie)); | 197 pages->assign(UTF8ToWide(cookie)); |
| 198 ASSERT_FALSE(pages->empty()); | 198 ASSERT_FALSE(pages->empty()); |
| 199 | 199 |
| 200 // Wait for the report.html to be loaded. |
| 201 ASSERT_TRUE(WaitUntilCookieValue( |
| 202 tab.get(), test_url, "__navigated_to_report", |
| 203 TestTimeouts::action_max_timeout_ms(), "1")); |
| 204 |
| 200 // Get the timing cookie value from the DOM automation. | 205 // Get the timing cookie value from the DOM automation. |
| 201 std::wstring wcookie; | 206 std::wstring wcookie; |
| 202 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", | 207 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", |
| 203 L"window.domAutomationController.send(" | 208 L"window.domAutomationController.send(" |
| 204 L"JSON.stringify(__get_timings()));", | 209 L"JSON.stringify(__get_timings()));", |
| 205 &wcookie)); | 210 &wcookie)); |
| 206 cookie = base::SysWideToNativeMB(wcookie); | 211 cookie = base::SysWideToNativeMB(wcookie); |
| 207 | 212 |
| 208 // JSON.stringify() encapsulates the returned string in quotes, strip them. | 213 // JSON.stringify() encapsulates the returned string in quotes, strip them. |
| 209 std::string::size_type start_idx = cookie.find("\""); | 214 std::string::size_type start_idx = cookie.find("\""); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 #define PAGE_CYCLER_TESTS(test, name, use_http) \ | 440 #define PAGE_CYCLER_TESTS(test, name, use_http) \ |
| 436 TEST_F(PageCyclerTest, name) { \ | 441 TEST_F(PageCyclerTest, name) { \ |
| 437 RunTest("times", test, use_http); \ | 442 RunTest("times", test, use_http); \ |
| 438 } \ | 443 } \ |
| 439 TEST_F(PageCyclerReferenceTest, name) { \ | 444 TEST_F(PageCyclerReferenceTest, name) { \ |
| 440 RunTest("times", test, use_http); \ | 445 RunTest("times", test, use_http); \ |
| 441 } | 446 } |
| 442 | 447 |
| 443 // This macro simplifies setting up regular and reference build tests | 448 // This macro simplifies setting up regular and reference build tests |
| 444 // for HTML5 database tests. | 449 // for HTML5 database tests. |
| 445 // FLAKY http://crbug.com/67918 | |
| 446 #define PAGE_CYCLER_DATABASE_TESTS(test, name) \ | 450 #define PAGE_CYCLER_DATABASE_TESTS(test, name) \ |
| 447 TEST_F(PageCyclerDatabaseTest, FLAKY_Database##name##File) { \ | 451 TEST_F(PageCyclerDatabaseTest, Database##name##File) { \ |
| 448 RunTest(test, test, false); \ | 452 RunTest(test, test, false); \ |
| 449 } \ | 453 } \ |
| 450 TEST_F(PageCyclerDatabaseReferenceTest, FLAKY_Database##name##File) { \ | 454 TEST_F(PageCyclerDatabaseReferenceTest, Database##name##File) { \ |
| 451 RunTest(test, test, false); \ | 455 RunTest(test, test, false); \ |
| 452 } | 456 } |
| 453 | 457 |
| 454 // This macro simplifies setting up regular and reference build tests | 458 // This macro simplifies setting up regular and reference build tests |
| 455 // for HTML5 Indexed DB tests. | 459 // for HTML5 Indexed DB tests. |
| 456 // FLAKY http://crbug.com/67918 | |
| 457 #define PAGE_CYCLER_IDB_TESTS(test, name) \ | 460 #define PAGE_CYCLER_IDB_TESTS(test, name) \ |
| 458 TEST_F(PageCyclerIndexedDatabaseTest, FLAKY_IndexedDB##name##File) { \ | 461 TEST_F(PageCyclerIndexedDatabaseTest, IndexedDB##name##File) { \ |
| 459 RunTest(test, test, false); \ | 462 RunTest(test, test, false); \ |
| 460 } \ | 463 } \ |
| 461 TEST_F(PageCyclerIndexedDatabaseReferenceTest, IndexedDB##name##File) { \ | 464 TEST_F(PageCyclerIndexedDatabaseReferenceTest, IndexedDB##name##File) { \ |
| 462 RunTest(test, test, false); \ | 465 RunTest(test, test, false); \ |
| 463 } | 466 } |
| 464 | 467 |
| 465 // These are shorthand for File vs. Http tests. | 468 // These are shorthand for File vs. Http tests. |
| 466 #define PAGE_CYCLER_FILE_TESTS(test, name) \ | 469 #define PAGE_CYCLER_FILE_TESTS(test, name) \ |
| 467 PAGE_CYCLER_TESTS(test, name, false) | 470 PAGE_CYCLER_TESTS(test, name, false) |
| 468 #define PAGE_CYCLER_HTTP_TESTS(test, name) \ | 471 #define PAGE_CYCLER_HTTP_TESTS(test, name) \ |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", | 530 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", |
| 528 DeleteTransactions); | 531 DeleteTransactions); |
| 529 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", | 532 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", |
| 530 PseudoRandomTransactions); | 533 PseudoRandomTransactions); |
| 531 #endif | 534 #endif |
| 532 | 535 |
| 533 // Indexed DB tests. | 536 // Indexed DB tests. |
| 534 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); | 537 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); |
| 535 | 538 |
| 536 } // namespace | 539 } // namespace |
| OLD | NEW |