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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc

Issue 693123002: Fixed memory leak of FileManagerPrivateApiTest.OnFileChanged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed to wait UI thread. Created 6 years, 2 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/chromeos/extensions/file_manager/file_manager_private_apitest.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc
index cf59a54f79235470168a3935eceb28a091e1ce1f..d0b4541e4916fc44fc962d5f7c96d87366963cda 100644
--- a/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/chromeos/file_manager/file_watcher.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/test/base/testing_profile.h"
+#include "chrome/test/base/ui_test_utils.h"
#include "chromeos/dbus/cros_disks_client.h"
#include "chromeos/disks/mock_disk_mount_manager.h"
#include "extensions/common/extension.h"
@@ -338,7 +339,10 @@ IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, OnFileChanged) {
"extension_3", base::Bind(&AddFileWatchCallback));
// event_router->addFileWatch create some tasks which are performed on message
- // loop. Wait until they are done.
+ // loop of BrowserThread::FILE. Wait until they are done.
+ content::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
+ // We also wait the UI thread here, since some tasks which are performed above
+ // message loop back results to the UI thread.
base::RunLoop().RunUntilIdle();
// When /a is deleted (1 and 2 is notified).
@@ -377,6 +381,6 @@ IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, OnFileChanged) {
"extension_3");
// event_router->removeFileWatch create some tasks which are performed on
- // message loop. wait until they are done.
- base::RunLoop().RunUntilIdle();
+ // message loop of BrowserThread::FILE. Wait until they are done.
+ content::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
}
« 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