diff options
author | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 20:42:29 +0000 |
---|---|---|
committer | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 20:42:29 +0000 |
commit | 3fe5c0d42006ed9b651816c284cfbe9f2154c4db (patch) | |
tree | a2522dbd3fe5eddc26f10a94786b1043c5c32f33 /content/worker/test/worker_uitest.cc | |
parent | 0df4a4887f7d2db22ec746d612ed6107a8f92c59 (diff) | |
download | chromium_src-3fe5c0d42006ed9b651816c284cfbe9f2154c4db.zip chromium_src-3fe5c0d42006ed9b651816c284cfbe9f2154c4db.tar.gz chromium_src-3fe5c0d42006ed9b651816c284cfbe9f2154c4db.tar.bz2 |
[flaky fixlet] Fixing WorkerTest.LimitTotal, WorkerTest.LimitPerPage
BUG=28445, 30332, 88958,36800, 48664
TEST=WorkerTest.LimitTotal, WorkerTest.LimitPerPage should pass consistently.
Review URL: http://codereview.chromium.org/9429022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123313 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/worker/test/worker_uitest.cc')
-rw-r--r-- | content/worker/test/worker_uitest.cc | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/content/worker/test/worker_uitest.cc b/content/worker/test/worker_uitest.cc index 873e694..2eb21f0 100644 --- a/content/worker/test/worker_uitest.cc +++ b/content/worker/test/worker_uitest.cc @@ -27,8 +27,6 @@ const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("workers"); const FilePath::CharType* kManySharedWorkersFile = FILE_PATH_LITERAL("many_shared_workers.html"); -const FilePath::CharType* kManyWorkersFile = - FILE_PATH_LITERAL("many_workers.html"); const FilePath::CharType* kQuerySharedWorkerShutdownFile = FILE_PATH_LITERAL("queued_shared_worker_shutdown.html"); const FilePath::CharType* kShutdownSharedWorkerFile = @@ -481,39 +479,36 @@ TEST_F(WorkerTest, DISABLED_MessagePorts) { RunLayoutTest(kLayoutTestFiles[i], kNoHttpPort); } -// OS X: http://crbug.com/48664 -// Windows/Linux: http://crbug.com/36800 -TEST_F(WorkerTest, DISABLED_LimitPerPage) { +TEST_F(WorkerTest, LimitPerPage) { int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), - FilePath(kManyWorkersFile)); + FilePath(kManySharedWorkersFile)); url = GURL(url.spec() + StringPrintf("?count=%d", max_workers_per_tab + 1)); NavigateToURL(url); ASSERT_TRUE(WaitForProcessCountToBe(1, max_workers_per_tab)); } -// Doesn't crash, but on all platforms, it sometimes fails. -// Flaky on all platforms: http://crbug.com/28445 -// Hangs on Linux: http://crbug.com/30332 -// Possibly causing ui_tests to hang on Mac: http://crbug.com/88958 -// Times out consistently on all platforms. -TEST_F(WorkerTest, DISABLED_LimitTotal) { +TEST_F(WorkerTest, LimitTotal) { int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerTabWhenSeparate; int total_workers = WorkerServiceImpl::kMaxWorkersWhenSeparate; + // Adding 1 so that we cause some workers to be queued. int tab_count = (total_workers / max_workers_per_tab) + 1; GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), - FilePath(kManyWorkersFile)); + FilePath(kManySharedWorkersFile)); url = GURL(url.spec() + StringPrintf("?count=%d", max_workers_per_tab)); scoped_refptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab.get()); - ASSERT_TRUE(tab->NavigateToURL(url)); + ASSERT_TRUE(tab->NavigateToURL( + GURL(url.spec() + StringPrintf("&client_id=%d", 0)))); scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); ASSERT_TRUE(window.get()); - for (int i = 1; i < tab_count; ++i) - ASSERT_TRUE(window->AppendTab(url)); + for (int i = 1; i < tab_count; ++i) { + ASSERT_TRUE(window->AppendTab(GURL( + url.spec() + StringPrintf("&client_id=%d", i)))); + } // Check that we didn't create more than the max number of workers. ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); |