Index: chrome/browser/task_manager/task_manager_browsertest.cc |
diff --git a/chrome/browser/task_manager/task_manager_browsertest.cc b/chrome/browser/task_manager/task_manager_browsertest.cc |
index 2cd1796a4e096271e3f6b03c9d813e0b1f15656e..af2c4746a9d4d7fe03da3fe1642bb5a4511c6313 100644 |
--- a/chrome/browser/task_manager/task_manager_browsertest.cc |
+++ b/chrome/browser/task_manager/task_manager_browsertest.cc |
@@ -778,8 +778,8 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, |
// Checks that task manager counts a worker thread JS heap size. |
// http://crbug.com/241066 |
-// Flaky, http://crbug.com/259368 |
-IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, DISABLED_WebWorkerJSHeapMemory) { |
+IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, WebWorkerJSHeapMemory) { |
+ ShowTaskManager(); |
ui_test_utils::NavigateToURL(browser(), GetTestURL()); |
const int extra_timeout_ms = 500; |
size_t minimal_heap_size = 2 * 1024 * 1024 * sizeof(void*); |
@@ -787,7 +787,7 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, DISABLED_WebWorkerJSHeapMemory) { |
"var blob = new Blob([\n" |
" 'mem = new Array(%lu);',\n" |
" 'for (var i = 0; i < mem.length; i += 16) mem[i] = i;',\n" |
- " 'postMessage();']);\n" |
+ " 'postMessage(i);']);\n" |
"blobURL = window.URL.createObjectURL(blob);\n" |
"worker = new Worker(blobURL);\n" |
"// Give the task manager few seconds to poll for JS heap sizes.\n" |
@@ -795,7 +795,7 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, DISABLED_WebWorkerJSHeapMemory) { |
" this,\n" |
" function () { window.domAutomationController.send(true); },\n" |
" %d);\n" |
- "worker.postMessage();\n", |
+ "worker.postMessage('go');\n", |
static_cast<unsigned long>(minimal_heap_size), |
GetUpdateTimeMs() + extra_timeout_ms); |
bool ok; |
@@ -803,7 +803,9 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, DISABLED_WebWorkerJSHeapMemory) { |
browser()->tab_strip_model()->GetActiveWebContents(), test_js, &ok)); |
ASSERT_TRUE(ok); |
- int resource_index = TaskManager::GetInstance()->model()->ResourceCount() - 1; |
+ ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchTab("title1.html"))); |
+ ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); |
+ int resource_index = FindResourceIndex(MatchTab("title1.html")); |
size_t result; |
ASSERT_TRUE(model()->GetV8Memory(resource_index, &result)); |