Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: chrome/browser/task_manager/task_manager_browsertest.cc

Issue 1027333003: TaskManagerBrowserTest.WebWorkerJSHeapMemory: update postMessage() usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix the test + enable Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698